public class URLVeiwer extends Object
Title: CASA Agent Infrastructure
Description:
A simple, static class to display a URL in the system browser.Under Unix, the system browser is hard-coded to be 'netscape'. Netscape must be in your PATH for this to work. This has been tested with the following platforms: AIX, HP-UX and Solaris.
Under Windows, this will bring up the default browser under windows, usually either Netscape or Microsoft IE. The default browser is determined by the OS. This has been tested under Windows 95/98/NT.
Examples:
BrowserControl.displayURL("http://www.javaworld.com")
BrowserControl.displayURL("file://c:\\docs\\index.html")
BrowserContorl.displayURL("file:///user/joe/index.html");
Note - you must include the url type -- either "http://" or "file://".
This class is adapted from Steven Spencer, JavaWorld.com, 01/01/99 and Ryan Stevens ("Follow-up tips").
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Company: Knowledge Science Group, University of Calgary
Modifier and Type | Class and Description |
---|---|
private static class |
URLVeiwer.PLATFORM |
Modifier and Type | Field and Description |
---|---|
private static String |
MAC_ID |
private static String |
UNIX_FLAG |
private static String[] |
UNIX_PATH |
private static String |
WIN_FLAG |
private static String |
WIN_ID |
private static String |
WIN_PATH |
Constructor and Description |
---|
URLVeiwer() |
Modifier and Type | Method and Description |
---|---|
static void |
displayURL(String url)
Display a file in the system browser.
|
static URLVeiwer.PLATFORM |
getPlatform() |
static void |
main(String[] args)
Simple example.
|
private static final String WIN_ID
private static final String MAC_ID
private static final String WIN_PATH
private static final String WIN_FLAG
private static final String[] UNIX_PATH
private static final String UNIX_FLAG
public static void displayURL(String url)
url
- the file's url (the url must start with either "http://" or
"file://").public static URLVeiwer.PLATFORM getPlatform()
public static void main(String[] args)