title: loading a file from classpath
body: <p>I have a line of code that is : <code>File file = new File(getFile())</code> in a java class <code>HandleData.java</code></p>
  
  <p>Method - <code>getFile()</code> takes the value of the property <code>fileName</code>. And <code>fileName</code> is injected through   <code>application_context.xml</code> with a bean section of the class -  HandleData as below:</p>
  
  <pre><code> &lt;bean id="dataHandler" class="com.profile.transaction.HandleData"&gt;
   &lt;property name="fileName" value="DataFile.xml"&gt;&lt;/property&gt;
   &lt;/bean&gt;
  </code></pre>
  
  <p>I build the project successfully and checked that - <code>DataFile.xml</code> is present in <code>WEB-INF/classes</code>. And the HandleData.class is present in <code>WEB-INF/classes/com/profile/transacon</code></p>
  
  <p>But when I run it it throws me filenotfound exception.
    If I inject the absolute path (<code>C:\MyProjectWorkspace\DataProject\target\ProfileService\WEB-INF\classes\DataFile.xml</code> it finds the file successfully.).</p>
  
  <p>Could someone help in figuring out the proper path to be injected so that the file is taken from the classpath ?</p>