net.i2p.apps.systray
Class UrlLauncher
java.lang.Object
net.i2p.apps.systray.UrlLauncher
public class UrlLauncher
- extends java.lang.Object
A quick and simple multi-platform URL launcher. It attempts to launch the
default browser for the host platform first, then popular third-party
browsers if that was not successful.
Handles Galeon, Internet Explorer, Konqueror, Links, Lynx, Mozilla, Mozilla
Firefox, Netscape, Opera, and Safari.
- Author:
- hypercubus
Method Summary |
static void |
main(java.lang.String[] args)
|
boolean |
openUrl(java.lang.String url)
Discovers the operating system the installer is running under and tries
to launch the given URL using the default browser for that platform; if
unsuccessful, an attempt is made to launch the URL using the most common
browsers. |
boolean |
openUrl(java.lang.String url,
java.lang.String browser)
Opens the given URL with the given browser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_shellCommand
ShellCommand _shellCommand
UrlLauncher
public UrlLauncher()
openUrl
public boolean openUrl(java.lang.String url)
throws java.lang.Exception
- Discovers the operating system the installer is running under and tries
to launch the given URL using the default browser for that platform; if
unsuccessful, an attempt is made to launch the URL using the most common
browsers.
- Parameters:
url
- The URL to open.
- Returns:
true
if the operation was successful, otherwise
false
.
- Throws:
java.lang.Exception
openUrl
public boolean openUrl(java.lang.String url,
java.lang.String browser)
throws java.lang.Exception
- Opens the given URL with the given browser.
- Parameters:
url
- The URL to open.browser
- The browser to use.
- Returns:
true
if the operation was successful,
otherwise false
.
- Throws:
java.lang.Exception
main
public static void main(java.lang.String[] args)