title: How to load a text file from a runnable jar
body: <p>If i have a project which has a text file inside of it and i want to be able to read this text file which will be stored in my runnable jar then how can i do this? Currently i have a setup like this</p>
  
  <pre><code>public void someMethod()
  {
      File f = new File("aFileInEclipseResourcesFolder.txt");
  
      doSomethingWithFile(f);
  }
  
  private void doSomethingWithFile(File f)
  {
      //print the data in the file;
  }
  </code></pre>
  
  <p>The issue is the application cant locate the file if i use this approach but if i use a hard coded path to the file then it works. I know you can use <code>getClass().getResourceAsStream()</code> but this wont allow me to get the already written file in to a file object without rewriting it again, or is this assumption incorrect?</p>
  
  <p>Regards</p>