title: Using getSystemResource to access files from a servlet
body: <p>I want to access files from a servlet using <code>getSystemResource</code>. These files reside inside the project itself and on the hard disk. For the files inside the project I used:</p>
  
  <pre><code>  ServletContext ctx = getServletContext();
    InputStream is = ctx.getResourceAsStream("/testing.txt");
  </code></pre>
  
  <p>It works if I place the files in <code>build/web</code> folder, but when I clean and build the project all of the files are deleted. Where should I put the files?</p>
  
  <p>For files outside the project, I use File object:</p>
  
  <pre><code> File file = new File("c://tmp//testing.txt");
   InputStream is= new FileInputStream(file); 
  </code></pre>
  
  <p>Is this a good practice?</p>