title: How to access static resources(WEB-INF) folder from and write tests for it
body: <p>I need to load a file resource when starting my server. 
  So I placed the file under webapp/WEB-INF. </p>
  
  <p>The problem is that the unit tests fail. </p>
  
  <p>I try to load the file using:</p>
  
  <pre><code>URL url = Utils.class.getClassLoader().getResource(fileName);
  File file = new File(url.getFile());
  BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
  </code></pre>
  
  <p>But the class loader does not find the file. It seems like it is looking for it at </p>
  
  <pre><code>file:/C:/&lt;local path&gt;/&lt;my project&gt;/target/test-classes/
  </code></pre>
  
  <ul>
  <li>There are different contexts for during normal mode and test mode </li>
  </ul>
  
  <p>I tried also the solution suggested <a href="https://stackoverflow.com/a/10649550/162345">here</a> but it didnt work</p>