title: Java: Access relative path outside ANY module
body: <p>I have a java project that consists of several modules:</p>
  
  <pre><code>myWebApp
    - conf     //not a java module, just text files
    - ModuleA
        -- src
        -- target
        -- moduleA.iml
        -- pom.xml
    - ModuleB
       ...
    - pom.xml
    - myWebApp.iml
    - myWebApp.env
  </code></pre>
  
  <p>I want to access <code>myWebApp.env</code> file (which is a java properties file) from a Class (which is obviously under a module's src folder), like:</p>
  
  <pre><code>InputStream is = new FileInputStream(&lt;RelativePathToEnvFile&gt;);
  </code></pre>
  
  <p>The problem is that relative paths seem to work only for subdirectories under modules' source root, or anywhere inside the classpath using the getResource() trick as mentioned <a href="https://stackoverflow.com/questions/573679/open-resource-with-relative-path-in-java">here</a> </p>
  
  <p>On every other language I know I could do something like:</p>
  
  <pre><code>InputStream is = new FileInputStream("../../../../../myWebApp.env");
  </code></pre>
  
  <p>Isn't this possible in java?</p>