mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-08-18 02:56:24 +00:00
SPARK-2268: handle file URLs better
This commit is contained in:
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user