title: How do I load a file from resource folder?
body: <p>My project has the following structure:</p>
  
  <pre><code>/src/main/java/
  /src/main/resources/
  /src/test/java/
  /src/test/resources/
  </code></pre>
  
  <p>I have a file in <code>/src/test/resources/test.csv</code> and I want to load the file from a unit test in <code>/src/test/java/MyTest.java</code> </p>
  
  <p>I have this code which didn't work. It complains "No such file or directory".</p>
  
  <pre><code>BufferedReader br = new BufferedReader (new FileReader(test.csv))
  </code></pre>
  
  <p>I also tried this</p>
  
  <pre><code>InputStream is = (InputStream) MyTest.class.getResourcesAsStream(test.csv))
  </code></pre>
  
  <p>This also doesn't work. It returns <code>null</code>. I am using Maven to build my project.</p>