Package net.i2p.apps.systray
Class UrlLauncher
- java.lang.Object
-
- net.i2p.apps.systray.UrlLauncher
-
- All Implemented Interfaces:
ClientApp
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, Konqueror, Links, Lynx, Mozilla, Mozilla Firefox, Netscape, Opera, and Safari.
- Author:
- hypercubus
-
-
Constructor Summary
Constructors Constructor Description UrlLauncher()
Constructor from SysTrayUrlLauncher(I2PAppContext context, ClientAppManager mgr, String[] args)
ClientApp constructor used from clients.config
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDisplayName()
ClientApp interfaceString
getName()
ClientApp interfaceClientAppState
getState()
ClientApp interfacestatic void
main(String[] args)
Obsolete, now uses ClientApp interfaceboolean
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 interfacevoid
startup()
ClientApp interface
-
-
-
Constructor Detail
-
UrlLauncher
public UrlLauncher(I2PAppContext context, ClientAppManager mgr, String[] args)
ClientApp constructor used from clients.config- Since:
- 0.9.18
-
UrlLauncher
public UrlLauncher()
Constructor from SysTray- Since:
- 0.9.18
-
-
Method Detail
-
openUrl
public boolean openUrl(String url) throws IOException
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. BLOCKING- Parameters:
url
- The URL to open.- Returns:
true
if the operation was successful, otherwisefalse
.- Throws:
IOException
-
openUrl
public boolean openUrl(String url, String browser) throws IOException
Opens the given URL with the given browser. BLOCKING- Parameters:
url
- The URL to open.browser
- The browser to use.- Returns:
true
if the operation was successful, otherwisefalse
.- Throws:
IOException
-
startup
public void startup()
ClientApp interface
-
getState
public ClientAppState getState()
ClientApp interface
-
getName
public String getName()
ClientApp interface
-
getDisplayName
public String getDisplayName()
ClientApp interface- Specified by:
getDisplayName
in interfaceClientApp
- Returns:
- non-null
- Since:
- 0.9.18
-
shutdown
public void shutdown(String[] args)
ClientApp interface
-
main
public static void main(String[] args)
Obsolete, now uses ClientApp interface
-
-