public class UrlLauncher extends Object
Handles Galeon, Internet Explorer, Konqueror, Links, Lynx, Mozilla, Mozilla Firefox, Netscape, Opera, and Safari.
Modifier and Type | Field and Description |
---|---|
(package private) ShellCommand |
_shellCommand |
Constructor and Description |
---|
UrlLauncher() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
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.
|
boolean |
waitForServer(String urlString)
Prevent bad user experience by waiting for the server to be there
before launching the browser.
|
ShellCommand _shellCommand
public boolean waitForServer(String urlString)
public boolean openUrl(String url) throws Exception
url
- The URL to open.true
if the operation was successful, otherwise
false
.Exception
public boolean openUrl(String url, String browser) throws Exception
url
- The URL to open.browser
- The browser to use.true
if the operation was successful,
otherwise false
.Exception
public static void main(String[] args)