|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.nikhef.slcshttps.util.BareBonesBrowserLaunch
public class BareBonesBrowserLaunch
Static class to provide a way to launch a proper default webbrowser from
Java. In JDK 1.6 onwards this is done using
java.awt.Desktop.browse()
, for older JDK versions we provide
sensible defaults. Supported platforms are: Mac OS X, GNU/Linux, Unix, Windows.
nl.nikhef.slcshttps
Field Summary | |
---|---|
private static String[] |
browsers
Browsers to try for Unix/Linux. |
private static String |
errMsg
error message used upon failure. |
private static String |
OS_MAC
String to identify Mac OS, it should start with "Mac OS". |
private static String |
OS_WIN
String to identify Windows, it should start with "Windows". |
Constructor Summary | |
---|---|
BareBonesBrowserLaunch()
|
Method Summary | |
---|---|
static void |
openURL(String url)
opens a webbrowser to a URL, tries first the JDK 1.6 java.awt.Desktop.getDesktop().browse(new URI(url)) method,
if that fails the action is platform dependent. |
static void |
openURL(URL url)
Opens a webbrowser to a URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String[] browsers
private static final String OS_MAC
private static final String OS_WIN
private static final String errMsg
Constructor Detail |
---|
public BareBonesBrowserLaunch()
Method Detail |
---|
public static void openURL(URL url) throws Exception
url
- url to open, type URL
.
Exception
- upon error.openURL(String)
public static void openURL(String url) throws Exception
java.awt.Desktop.getDesktop().browse(new URI(url))
method,
if that fails the action is platform dependent.
url
- url to open, type String
Exception
- upon error.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
nl.nikhef.slcshttps | Mischa Sallé - msalle(AT)nikhef.nl |