1 Reply Latest reply: May 27, 2008 2:15 PM by 796447 RSS

    java.io.FileOutputStream

    807591
      Hi,

      Can anyone point out why I am getting the FileNotFoundException in the below method.

      String fileName is "/tmp/123456789.png"


      private static void bufferToFile(String fileName, byte[] strB)
      {

      try
      {
      java.io.FileOutputStream tFile = new java.io.FileOutputStream(fileName);
           tFile.write(strB);
      tFile.close();
      }
      catch (Exception ex2)
      {
      ex2.printStackTrace();
      }
      }


      The exception stack trace says the following.
      java.io.FileNotFoundException: \tmp\1211916221149070718.png (The system cannot find the path specified)


      I do not have a 'tmp' folder and 123456789.png file in my web context .
      If the specifed file is not found, will it not create one?

      Please clarify

      Jay