Hi all.
I'm having problems when triyin to call Desktop.open(), and also browse, edit, ...
I think there is a problem when thera are white spaces on file path.
I'm under WinXP sp2, JVM 1.6.0_10-b33.
Of course, all tested files exists on the shared folder "proyectosShared" of server "fiuu".
Here is a little example and the console out.
public static void main(String[] args) {
String f1 = "\\\\fiuu\\proyectosShared\\2\\espacioProyecto\\deste proyecto\\prueba 1\\383 granollers frontal.jpg";
String f2 = "//fiuu/proyectosShared/2/espacioProyecto/deste proyecto/prueba 1/383 granollers frontal.jpg";
String f3 = "\\\\fiuu\\proyectosShared\\2\\espacioProyecto\\index .html";
String f4 = "//fiuu/proyectosShared/2/espacioProyecto/index .html";
String f5 = "\\\\fiuu\\proyectosShared\\2\\espacioProyecto\\entorn_1.3p2.rar";
String f6 = "//fiuu/proyectosShared/2/espacioProyecto/entorn_1.3p2.rar";
try {
Desktop.getDesktop().open(new File(f1));
} catch (IOException e) { e.printStackTrace(); }
try {
Desktop.getDesktop().open(new File(f2));
} catch (IOException e) { e.printStackTrace(); }
try {
Desktop.getDesktop().open(new File(f3));
} catch (IOException e) { e.printStackTrace(); }
try {
Desktop.getDesktop().open(new File(f4));
} catch (IOException e) { e.printStackTrace(); }
try {
Desktop.getDesktop().open(new File(f5));
} catch (IOException e) { e.printStackTrace(); }
try {
Desktop.getDesktop().open(new File(f6));
} catch (IOException e) { e.printStackTrace(); }
}
Console out (1,2,3,4 failed, 5 and 6 ok):
java.io.IOException: Failed to open file:////fiuu/proyectosShared/2/espacioProyecto/deste%20proyecto/prueba%20%201/383%20granollers%20frontal.jpg. Error message: El sistema no puede hallar la ruta especificada.
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 DesktopTest.main(DesktopTest.java:18)
java.io.IOException: Failed to open file:////fiuu/proyectosShared/2/espacioProyecto/deste%20proyecto/prueba%20%201/383%20granollers%20frontal.jpg. Error message: El sistema no puede hallar la ruta especificada.
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 DesktopTest.main(DesktopTest.java:23)
java.io.IOException: Failed to open file:////fiuu/proyectosShared/2/espacioProyecto/index%20.html. Error message: El sistema no puede hallar la ruta especificada.
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 DesktopTest.main(DesktopTest.java:28)
java.io.IOException: Failed to open file:////fiuu/proyectosShared/2/espacioProyecto/index%20.html. Error message: El sistema no puede hallar la ruta especificada.
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 DesktopTest.main(DesktopTest.java:33)
thanx!