title: IOException : When Executing Java File Code in Linux box
body: <p>Here is My WriteFile</p>
  
  <pre><code>WriteFile.writeFile(str, "./test/my.html");
  </code></pre>
  
  <p>And <code>writeFile()</code> method code</p>
  
  <pre><code>public static void writeFile(String content, String fileName)
    {
      try
      {
        File file = new File(fileName);
        if (!file.exists()) {
          file.createNewFile();
        }
        FileWriter fw = new FileWriter(file.getAbsoluteFile());
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write(content);
        bw.close();
      }
      catch (IOException e)
      {
        e.printStackTrace();
      }
    }
  </code></pre>
  
  <p>This Code Working fine With Windows but in Linux I am getting below exception </p>
  
  <pre><code>java.io.IOException: No such file or directory
      at java.io.UnixFileSystem.createFileExclusively(Native Method)
      at java.io.File.createNewFile(File.java:1006)
      at org.sewa.util.WriteFile.writeFile(WriteFile.java:25)
  </code></pre>