JDK-4135185 : Problem saving a file to a network drive using the FileDialog in SAVE mode
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.4
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-05-05
  • Updated: 1998-05-06
  • Resolved: 1998-05-06
Related Reports
Duplicate :  
Description
==========================================================================
carlos.lucasius@canada 1998-05-05:
Bug reported by Corel (licensee) for AWT using JDK1.1.4 on WINNT4.0.
Corel: "Very critical bug for our product - requires immediate attention."

To reproduce:

(1) Execute the following code: 

  FileDialog f = new FileDialog(aFrame, "Save", FileDialog.SAVE); 
  f.show(); 
  if (f.getFile() != null) 
  { 
   String szFileName = f.getDirectory(); 
   szFileName += f.getFile(); 

   try 
   { 
     BufferedWriter out = new BufferedWriter(new FileWriter(szFileName)); 
   } 
   catch(IOException ex) 
   { 
    System.out.println("Exception thrown " + ex); 
   } 
  } 

(2) When the file dialog appears, in the file name edit field type
the full path of the file save location on a network drive  --  e.g.
\\servername\temp\filename.ext (where "\\servername\temp" is the
network drive and "filename.ext" is the file name)

(3) Click the save button

RESULT:

A FileNotFoundException is thrown on creation of the FileWriter.

NOTE:

This is a problem when we specify the network drive name, e.g.,
"\\servername\temp\filename.ext". This is not a problem when
we specify the network drive letter (assuming that the network
drive is mapped to a drive letter), e.g., "h:\filename.ext".

Comments
WORK AROUND Specify the network drive letter (assuming that the network drive is mapped to a drive letter), e.g., "h:\filename.ext"
11-06-2004

PUBLIC COMMENTS Duplicate of 4032066.
10-06-2004

EVALUATION This isn't really a problem with FileDialog, but with the java.io.* classes. Until recently none of the filename parsing in Java worked correctly with Win32 UNC path names. Happily this has been fixed as of 1.1.6/1.2 beta3. The relevant bug number is 4032066. robi.khan@eng 1998-05-06
06-05-1998