FileInputStream not working in web application
<p>We are trying to read a property file in a servlet using fileInputStream.</p>

<p>However we are constanlty getting a file not found exception.</p>

<p>This is the piece of code we are using</p>

<pre><code>Properties properties = new Properties();
          File propertyFile = new File("config" + File.separatorChar + "abc.properties");
          try {
          FileInputStream propertyFileStream = new FileInputStream(propertyFile);
                properties.load(propertyFileStream);
                propertyFileStream.close();
            } catch (IOException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
</code></pre>

<p>While using getResourceAsStream it is working fine.</p>

<p>However we need to understand why FileInputStream is not working.</p>

<p>We have placed the config\abc.properties file in the webInf. We have also tried placing it in the src folder(java classpath), the webContent folder, the WebInf\Classes folder but no success.</p>