-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6u10
-
x86
-
windows_xp
FULL PRODUCT VERSION :
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Versión 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
A folder containing a file with white space must be shared.
A DESCRIPTION OF THE PROBLEM :
Calling Desktop.getDesktop.open() for a file on a shared folder containing whites spaces in his name fails. The file exists.
Also discused on http://forums.sun.com/thread.jspa?threadID=5350089.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Share a folder.
Put inside two files, "test.txt" and "te st.txt".
Try to open both with Desktop.getDesktop().open().
Calls will be some like this:
open("\\\\myComputer\\sharedFolder\\te st.txt");
open("//myComputer/sharedFolder/te st.txt");
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File must be open by some program configured on my windows (usually notepad)
ACTUAL -
\\127.0.0.1\tmp\te st.txt
file:////127.0.0.1/tmp/te%20st.txt
exists=true
canRead=true
canWrite=true
Exception in thread "main" java.io.IOException: Failed to open file:////127.0.0.1/tmp/te%20st.txt. Error message: The operation completed successfully.
at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:59)
at sun.awt.windows.WDesktopPeer.open(WDesktopPeer.java:36)
at java.awt.Desktop.open(Desktop.java:254)
at DesktopTestWithSpaces.main(DesktopTestWithSpaces.java:19)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.io.IOException: Failed to open file:////127.0.0.1/tmp/te%20st.txt. Error message: The operation completed successfully.
at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:59)
at sun.awt.windows.WDesktopPeer.open(WDesktopPeer.java:36)
at java.awt.Desktop.open(Desktop.java:254)
at DesktopTestWithSpaces.main(DesktopTestWithSpaces.java:19)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class DesktopTestWithSpaces {
public static void main(String[] args) throws Exception {
// this works
// File file = new File("//127.0.0.1/tmp/test.txt");
// this does not (both files exist)
File file = new File("//127.0.0.1/tmp/te st.txt");
URI uri = file.toURI();
System.out.println(file.getAbsolutePath());
System.out.println(uri.toString());
System.out.println("exists=" + file.exists());
System.out.println("canRead=" + file.canRead());
System.out.println("canWrite=" + file.canWrite());
Desktop.getDesktop().open(file);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found.
Also tried with file.getCanonicalFile(), file.getAbsoluteFile(), with a URI, ....
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Versión 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
A folder containing a file with white space must be shared.
A DESCRIPTION OF THE PROBLEM :
Calling Desktop.getDesktop.open() for a file on a shared folder containing whites spaces in his name fails. The file exists.
Also discused on http://forums.sun.com/thread.jspa?threadID=5350089.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Share a folder.
Put inside two files, "test.txt" and "te st.txt".
Try to open both with Desktop.getDesktop().open().
Calls will be some like this:
open("\\\\myComputer\\sharedFolder\\te st.txt");
open("//myComputer/sharedFolder/te st.txt");
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File must be open by some program configured on my windows (usually notepad)
ACTUAL -
\\127.0.0.1\tmp\te st.txt
file:////127.0.0.1/tmp/te%20st.txt
exists=true
canRead=true
canWrite=true
Exception in thread "main" java.io.IOException: Failed to open file:////127.0.0.1/tmp/te%20st.txt. Error message: The operation completed successfully.
at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:59)
at sun.awt.windows.WDesktopPeer.open(WDesktopPeer.java:36)
at java.awt.Desktop.open(Desktop.java:254)
at DesktopTestWithSpaces.main(DesktopTestWithSpaces.java:19)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.io.IOException: Failed to open file:////127.0.0.1/tmp/te%20st.txt. Error message: The operation completed successfully.
at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:59)
at sun.awt.windows.WDesktopPeer.open(WDesktopPeer.java:36)
at java.awt.Desktop.open(Desktop.java:254)
at DesktopTestWithSpaces.main(DesktopTestWithSpaces.java:19)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class DesktopTestWithSpaces {
public static void main(String[] args) throws Exception {
// this works
// File file = new File("//127.0.0.1/tmp/test.txt");
// this does not (both files exist)
File file = new File("//127.0.0.1/tmp/te st.txt");
URI uri = file.toURI();
System.out.println(file.getAbsolutePath());
System.out.println(uri.toString());
System.out.println("exists=" + file.exists());
System.out.println("canRead=" + file.canRead());
System.out.println("canWrite=" + file.canWrite());
Desktop.getDesktop().open(file);
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found.
Also tried with file.getCanonicalFile(), file.getAbsoluteFile(), with a URI, ....