FileNotFoundException when using FileWriter
<p>I am trying to write some message to text file. The text file is in the server path. I am able to read content from that file. But i am unable to write content to that file. I am getting FileNotFoundException: \wastServer\apps\LogPath\message.txt (Access Denied).</p>

<p>Note: File has a read and write permissions.</p>

<p>But where i am doing wrong. Please find my code below.</p>

<p>Code:</p>

<pre><code>    String FilePath = "\\\\wastServer\\apps\\LogPath\\message.txt";

    try {
        File fo = new File(FilePath);
        FileWriter fw=new FileWriter(fo); 
        BufferedWriter bw=new BufferedWriter(fw); 
        bw.write("Hello World"); 
        bw.flush(); 
        bw.close(); 
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
</code></pre>

<p>Please help me on this?</p>
