title: To get the root path of file in java
body: <p>I am using eclipse Indigo IDE ..I am developing a jsp application (<strong>myProject</strong>) using eclipse in which i have a property file (<strong>myProject\webcontent\db.properties</strong>) for configuring database credentials. </p>
  
  <p>I am trying to access this file from a class (<strong>myProject\src\samplePackage\sampleDBConnect.java</strong>). I have exported <strong>samplePackage.jar</strong> into *<em>myProject\webContent\WEB-INF\lib*</em>.</p>
  
  <p>I have a Test.jsp page which calls a method in sampleDBConnect.java.</p>
  
  <p>When i am trying to run this Test.jsp page, the current directory path shows <strong>C:\Documents and Settings\username</strong>.  I have my project in some other drive(E:). </p>
  
  <p>Can someone tell me how to access the properties file....</p>