-
Bug
-
Resolution: Fixed
-
P2
-
6
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8008797 | 8 | Anton Litvinov | P2 | Closed | Fixed | b84 |
JDK-8021761 | 7u60 | Anton Litvinov | P2 | Resolved | Fixed | b01 |
JDK-8021554 | 7u51 | Anton Litvinov | P2 | Resolved | Fixed | b01 |
JDK-8018647 | 7u45 | Anton Litvinov | P2 | Closed | Fixed | b05 |
JDK-8008798 | 7u40 | Anton Litvinov | P2 | Closed | Fixed | b20 |
JDK-8016823 | 7u25 | Anton Litvinov | P2 | Closed | Fixed | b31 |
JDK-8013637 | 7u21 | Anton Litvinov | P2 | Closed | Fixed | b31 |
JDK-8017406 | 6u65 | Anton Litvinov | P2 | Closed | Fixed | b02 |
JDK-8019331 | 6u51 | Anton Litvinov | P2 | Resolved | Fixed | b31 |
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Hi,
The java.awt.Desktop class does not allow to open a network file with blank character into the path. For example, it fails to open "//serverName/drive/Temp/my folder/a simple file.xxx", where xxx may be any extension : txt, pdf...
For information, it works if the path contains the drive letter "N:/Temp/my folder/a simple file.txt", or if the path does not contain any blank like "//serverName/drive/Temp/my_folder/a_simple_file.txt".
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should open the file with the application used for its extension, like Notepad for txt file.
ACTUAL -
IOException
ERROR MESSAGES/STACK TRACES THAT OCCUR :
The ouput is:
java.io.IOException: Failed to open file:////serverName/drive/Temp/my%20folder/a%20simple%20file.txt. Error message: Le chemin d'accès spécifié est introuvable.
at sun.awt.windows.WDesktopPeer.ShellExecute(Unknown Source)
at sun.awt.windows.WDesktopPeer.open(Unknown Source)
at java.awt.Desktop.open(Unknown Source)
at Swing.myDesktop.main(jvDesktop.java:26)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package Swing;
import java.awt.*;
import java.io.*;
public class myDesktop
{
public static void main(String[] args)
{
try
{
Desktop myDesktop = null;
if (Desktop.isDesktopSupported())
myDesktop = Desktop.getDesktop();
if (myDesktop != null)
{
// -> Works
//File myFile = new File("//sma-nasft04-1/servev/Temp/my_folder/a_simple_file.txt");
//File myFile = new File("N:/Temp/my folder/a simple file.txt");
// -> Does not work
File myFile = new File("//sma-nasft04-1/servev/Temp/my folder/a simple file.txt");
if (myFile.exists())
myDesktop.open(myFile);
else
System.out.println("This file is not a valid one");
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8019331 java.awt.Desktop cannot open file with Windows UNC filename
- Resolved
-
JDK-8021554 java.awt.Desktop cannot open file with Windows UNC filename
- Resolved
-
JDK-8021761 java.awt.Desktop cannot open file with Windows UNC filename
- Resolved
-
JDK-8008797 java.awt.Desktop cannot open file with Windows UNC filename
- Closed
-
JDK-8008798 java.awt.Desktop cannot open file with Windows UNC filename
- Closed
-
JDK-8013637 java.awt.Desktop cannot open file with Windows UNC filename
- Closed
-
JDK-8016823 java.awt.Desktop cannot open file with Windows UNC filename
- Closed
-
JDK-8017406 java.awt.Desktop cannot open file with Windows UNC filename
- Closed
-
JDK-8018647 java.awt.Desktop cannot open file with Windows UNC filename
- Closed