Java FileNotFoundException even though file exists
<p>I am trying to read a file located at "C:\Users\Siddharth\Documents\aarti\yeh_vidhi_mangal.txt". Following code indicates that file exists</p>

<pre><code>String filename = "C:\\Users\\Siddharth\\Documents\\aarti\\yeh_vidhi_mangal.txt";
        File file = new File(filename);
        System.out.println(file.exists());
</code></pre>

<p>but when I try to open the file using</p>

<pre><code>FileInputStream in = new FileInputStream(file);
</code></pre>

<p>a <code>FileNotFoundException</code> is thrown. Is this because access is denied? I checked file permissions and they are fine. </p>

<p>I have also tried working without eclipse. from the command line: </p>

<blockquote>
<pre><code> C:\Users\Siddharth\workspace\file_io_test\src&gt;javac Foo.java
    Foo.java:16: error: unreported exception FileNotFoundException; must be caught o
    r declared to be thrown
                    FileInputStream in = new FileInputStream(file);
                                         ^
    1 error
</code></pre>
</blockquote>
