title: Java file path in web project
body: <p>I need to access the resource files in my web project from a class. The problem is that the paths of my development environment are different from the ones when the project is deployed.</p>
  
  <p>For example, if I want to access some css files while developing I can do like this:</p>
  
  <pre><code>File file = new File("src/main/webapp/resources/styles/some.css/");
  </code></pre>
  
  <p>But this may not work once it's deployed because there's no <code>src</code> or <code>main</code> directories in the target folder. How could I access the files consistently?</p>