public class UrlLauncher extends Object implements ClientApp
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, Falkon, Konqueror, Links, Lynx, Mozilla, Mozilla Firefox, Netscape, Opera, and Safari.
| Constructor and Description |
|---|
UrlLauncher()
Constructor from SysTray
|
UrlLauncher(I2PAppContext context,
ClientAppManager mgr,
String[] args)
ClientApp constructor used from clients.config
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDisplayName()
ClientApp interface
|
String |
getName()
ClientApp interface
|
ClientAppState |
getState()
ClientApp interface
|
static void |
main(String[] args)
Obsolete, now uses ClientApp interface
|
boolean |
openUrl(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(String url,
String browser)
Opens the given URL with the given browser.
|
void |
shutdown(String[] args)
ClientApp interface
|
void |
startup()
ClientApp interface
As of 0.9.46, stops immediately if JVM is a Windows or Linux Service.
|
public UrlLauncher()
public UrlLauncher(I2PAppContext context, ClientAppManager mgr, String[] args)
mgr - null OKargs - URL in args[0] or null args for router consolepublic String getDisplayName()
getDisplayName in interface ClientApppublic String getName()
public ClientAppState getState()
public static void main(String[] args)
public boolean openUrl(String url) throws IOException
url - The URL to open.true if the operation was successful, otherwise
false.IOExceptionpublic boolean openUrl(String url, String browser) throws IOException
url - The URL to open.browser - The browser to use. See above for quoting rules.true if the operation was successful,
otherwise false.IOExceptionpublic void shutdown(String[] args)