title: How to open a file in a servlet?
body: <p>I'm trying to open a file but the current CWD is wrong. I've tried to open class file from <code>/ROOT/app/WEB-INF/classes/pl/jcubic/Service.class</code></p>
  
  <p>but current working directory using:</p>
  
  <pre><code>    File root = new File(".");
      root.getAbsolutePath();
  </code></pre>
  
  <p>Return <code>/var/lib/tomcat7/.</code> path, how can I get the <code>app</code> directory from a servlet (I want my code to work even if I change the name or run on Windows machine).</p>