mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1182: File path for a URL bookmark is not working
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12036 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
konstantin.zolotarev
parent
6c93069ac1
commit
7480029f4c
@ -25,11 +25,14 @@ import java.net.URI;
|
||||
public class BrowserLauncher {
|
||||
|
||||
public static void openURL(String url) throws Exception {
|
||||
if (url.startsWith("http") ||
|
||||
url.startsWith("ftp")) {
|
||||
Desktop.getDesktop().browse(new URI(url));
|
||||
if (url.startsWith("http") || url.startsWith("ftp") || url.startsWith("file")) {
|
||||
|
||||
if (url.startsWith("file") && url.contains(" ")) {
|
||||
url = url.replace(" ", "%20");
|
||||
}
|
||||
else {
|
||||
Desktop.getDesktop().browse(new URI(url));
|
||||
|
||||
} else {
|
||||
Desktop.getDesktop().browse(new URI("http://" + url));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user