|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.huguesjohnson.LaunchBrowser
public class LaunchBrowser
class LaunchBrowser usage: String result=(new LaunchBrowser()).launch("http://www.wherever.com"); alternate usage: String verboseResult=(new LaunchBrowser()).launch("http://www.wherever.com",true); alternate usage: String verboseResult=(new LaunchBrowser()).launch("file://c:\\some-folder\\some-file.html",true); alternate usage: String verboseResult=(new LaunchBrowser()).launch("file:///some-dir/some-file.html",true); This has only been tested on Windows 2000, if it doesn't work on another OS please set verbose to true to debug. I can just about guarantee this will not work with OS/2, the algorithm to lookup the operating system explicitly checks for Windows and MacOS with the default being UNIX/Linux. UNIX/Linux is considered the default because each "flavor" of UNIX/Linux returns a different name to the System.getProperty("os.name") call.. there is no standard name. For example, HP-UX returns "HP-UX" while Solaris returns "Solaris". This also assumes that if UNIX/Linux is the OS, then netscape is installed. As far as I know there is no way to pass UNIX/Linux an URL and have it figure out the default browser. Should this implement runnable?
Constructor Summary | |
---|---|
LaunchBrowser()
constructor |
Method Summary | |
---|---|
java.lang.String |
launch(java.lang.String url)
Launches a web browser with the specified url. |
java.lang.String |
launch(java.lang.String url,
boolean verbose)
Launches a web browser with the specified url. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LaunchBrowser()
Method Detail |
---|
public java.lang.String launch(java.lang.String url)
url
- the address to openpublic java.lang.String launch(java.lang.String url, boolean verbose)
url
- the address to openverbose
- whether or not to return verbose output, useful for debugging. This is false if launch(url) is used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |