fr.tireme.shared
Class SystemUtils

java.lang.Object
  extended by fr.tireme.shared.SystemUtils

public class SystemUtils
extends java.lang.Object

A simple, static class to access some System utilities.

Since:
schemaDoc V1
Author:
pierre

Field Summary
static int LINUX_PLATEFORM
          Identify a linux plateform running the actual program
static int WINDOWS_PLATEFORM
          Identify a windows plateform running the actual program
 
Method Summary
 void displayURL(java.lang.String url)
          Display a file in the system browser.
static SystemUtils getInstance()
           
 int getPlateformType()
          Provide the plateform type returning either WINDOWS_PLATEFORM or LINUX_PLATEFORM values.
 boolean isLinuxPlatform()
          Try to determine whether this application is running under Linux by examing the "os.name" property.
 boolean isWindowsPlatform()
          Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINUX_PLATEFORM

public static final int LINUX_PLATEFORM
Identify a linux plateform running the actual program

See Also:
Constant Field Values

WINDOWS_PLATEFORM

public static final int WINDOWS_PLATEFORM
Identify a windows plateform running the actual program

See Also:
Constant Field Values
Method Detail

getInstance

public static SystemUtils getInstance()
Returns:
The unique instance of this class.

displayURL

public void displayURL(java.lang.String url)
                throws StandardException
Display a file in the system browser. If you want to display a file, you must include the absolute path name.

Under Unix, the system browser is hard-coded to be 'mozilla'. Mozilla must be in your PATH for this to work. This has been tested with linux plateform.

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.

Note - you must include the url type -- either "http://" or "file://".

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

getPlateformType

public int getPlateformType()
Provide the plateform type returning either WINDOWS_PLATEFORM or LINUX_PLATEFORM values.

Returns:
the plateform type

isLinuxPlatform

public boolean isLinuxPlatform()
Try to determine whether this application is running under Linux by examing the "os.name" property.

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

isWindowsPlatform

public 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