SPARK-2268: handle file URLs better

This commit is contained in:
Sergey Ponomarev
2026-07-25 21:14:50 +03:00
parent c54c7989c6
commit 687a237260

View File

@ -78,7 +78,6 @@ public class BrowserLauncher {
// Last resort: try as URL with https prefix
openAsHttpsUrl(url);
} catch (Exception e) {
e.printStackTrace();
Log.error("Unable to open url: " + url, e);
}
}
@ -192,8 +191,9 @@ public class BrowserLauncher {
}
public static void openFolder(File file) {
if (!Desktop.isDesktopSupported())
if (!Desktop.isDesktopSupported()) {
return;
}
Desktop dt = Desktop.getDesktop();
try {
dt.open(file);
@ -201,12 +201,4 @@ public class BrowserLauncher {
Log.error("Unable to open folder: " + file, ex);
}
}
public static void main(String[] args) throws InterruptedException {
// openURL("C:\\Users\\Admin\\Desktop\\avatar.jpg");
// openURL("C:\\Users\\Admin\\Desktop\\avatar.jpg");
openURL("D:\\work\\Spark\\core\\src\\main\\resources\\images\\alert.png");
// openURL("ftp://jkl.mn");
// openURL("ftp://jkl.mn");
}
}