jwo.utils
Class JWBrowser

java.lang.Object
  |
  +--jwo.utils.JWBrowser

public class JWBrowser
extends Object

Displays a given URL in the system browser. Under UNIX, the system browser is hard-coded to be Netscape which must be in the users PATH to work. Under Windows, the system default browser is used.

Version:
1.8.0, 8th May, 2000
Author:
Steven Spencer with modifications by Jo Wood

Constructor Summary
JWBrowser()
           
 
Method Summary
static boolean displayFile(String file)
          Displays a given file using the default application.
static boolean displayURL(String url)
          Display a file in the system browser.
static boolean isWindowsPlatform()
          Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.
static void main(String[] args)
          Displays the given file in the system's default browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWBrowser

public JWBrowser()
Method Detail

main

public static void main(String[] args)
Displays the given file in the system's default browser. Note that under Unix, browser is assumed to be netscape.

Parameters:
args - Command line arguments.

displayFile

public static boolean displayFile(String file)
Displays a given file using the default application. Works with windows platforms only.

Parameters:
file - Name of file to display.
Returns:
True if file displayed.

displayURL

public static boolean displayURL(String url)
Display a file in the system browser. If you want to display a file, you should include the absolute path name.

Parameters:
url - the file's url (the url must start with either "http://" or "file://").

isWindowsPlatform

public static boolean isWindowsPlatform()
Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.

Returns:
true if this application is running under a Windows OS