How to access the local project file using java.nio.file.Path? <p>I am new to java.nio world.</p> <p>I have a log file app.log inside my Java module. (I am using Intellij 11).</p> <p>In a module, i have test folder, i have a local file app.jar.</p> <p>I want to read this file into InputStream using Files.newInputStream(path) method.</p> <p>The problem is that in windows, i have to give complete value for input path as,</p> <pre><code>Path path = Paths.get("C:\\Perforce\\depot\\Project\\module\\src\\test\\a\\b\\c\\app.jar"); </code></pre> <p>I am not sure if somebody gets this code and has similar folder structure on their machine to access app.jar</p> <p>I have kept the file app.jar in local folder where my test is written. Is there a way through which i can generalize this Path? if my Test class is under the same folder where app.jar is residing, is there any mechanism to avoid mentioning the complete local path?</p> <p>Thanks, Vijay Bhore</p>