de.infinityloop.util.sys
Class HostProperties

java.lang.Object
  extended by de.infinityloop.util.sys.HostProperties

public class HostProperties
extends java.lang.Object

Collection of VM host-specific properties for easy retrieval.


Field Summary
static int AIX
           
static int DIGITAL_UNIX
           
static int FREEBSD
           
static int HP_UX
           
static int IRIX
           
static int LINUX
           
static int MAC_OS
           
static int MAC_OSX
           
static int MPE_IX
           
static int NETWARE
           
static int OS_2
           
static int PLATFORM_LINUX
           
static int PLATFORM_MACOS
           
static int PLATFORM_MACOSX
           
static int PLATFORM_NETWARE
           
static int PLATFORM_OS2
           
static int PLATFORM_UNIX
           
static int PLATFORM_UNKNOWN
           
static int PLATFORM_WINDOWS
           
static int SOLARIS
           
static int UNKNOWN
           
static int WINDOWS_2k
           
static int WINDOWS_95
           
static int WINDOWS_98
           
static int WINDOWS_NT
           
static int WINDOWS_XP
           
 
Constructor Summary
HostProperties()
          Initialize the host properties.
HostProperties(java.lang.String home, java.lang.String vendor, java.lang.String app)
          Initialize host properties with specific relative application dir If home !
 
Method Summary
static java.lang.String getAppDTDsDir()
          Default directories on several systems by platform.
static java.lang.String getAppEncodingsDir()
          Default directories on several systems by platform.
static java.lang.String getAppLicensesDir()
          Default directories on several systems by platform.
static java.lang.String getAppLogDir()
          Default directories on several systems by platform.
static java.lang.String getAppPreferencesDir()
          Default directories on several systems by platform.
static java.lang.String getAppSupportDir()
          Default directories on several systems by platform.
static java.lang.String getAppTmpDir()
          Default directories on several systems by platform.
static java.lang.String getBootVolumeName()
          Retrieve the boot volume name.
static java.lang.String getCurrentDir()
          Current Directory
static java.lang.String getDirSep()
          Retrieve the directory separation character string.
static int getHostOS()
          Retrieve the OS we're running ongeneral platform we are running on.
static int getHostPlatform()
          Retrieve general platform we are running on.
static java.lang.String getHostProperty(java.lang.String name, java.lang.String dflt)
          generic Property retrieval function
static int getJREversion()
          Returns the JRE-version (as an int) that executes this program (we take only the first three tokens of the version-string into account).
static java.lang.String getLineSep()
          Retrieve the line separation character string.
static java.lang.String getPathSep()
          Retrieve the path separation character string.
static java.lang.String getPreferencesDir()
          Default directories on several systems by platform.
static java.lang.String getSupportDir()
          Default directories on several systems by platform.
static java.lang.String getUserHomeDir()
          Home directory
static java.lang.String getVendorLicensesDir()
          Default directories on several systems by platform.
static java.lang.String getVendorPreferencesDir()
          Default directories on several systems by platform.
static java.lang.String getVendorSupportDir()
          Default directories on several systems by platform.
static void logStatus()
          Writes current properties to the log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLATFORM_UNKNOWN

public static final int PLATFORM_UNKNOWN
See Also:
Constant Field Values

PLATFORM_WINDOWS

public static final int PLATFORM_WINDOWS
See Also:
Constant Field Values

PLATFORM_MACOS

public static final int PLATFORM_MACOS
See Also:
Constant Field Values

PLATFORM_MACOSX

public static final int PLATFORM_MACOSX
See Also:
Constant Field Values

PLATFORM_LINUX

public static final int PLATFORM_LINUX
See Also:
Constant Field Values

PLATFORM_UNIX

public static final int PLATFORM_UNIX
See Also:
Constant Field Values

PLATFORM_OS2

public static final int PLATFORM_OS2
See Also:
Constant Field Values

PLATFORM_NETWARE

public static final int PLATFORM_NETWARE
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

WINDOWS_95

public static final int WINDOWS_95
See Also:
Constant Field Values

WINDOWS_98

public static final int WINDOWS_98
See Also:
Constant Field Values

WINDOWS_2k

public static final int WINDOWS_2k
See Also:
Constant Field Values

WINDOWS_XP

public static final int WINDOWS_XP
See Also:
Constant Field Values

MAC_OS

public static final int MAC_OS
See Also:
Constant Field Values

MAC_OSX

public static final int MAC_OSX
See Also:
Constant Field Values

LINUX

public static final int LINUX
See Also:
Constant Field Values

SOLARIS

public static final int SOLARIS
See Also:
Constant Field Values

OS_2

public static final int OS_2
See Also:
Constant Field Values

MPE_IX

public static final int MPE_IX
See Also:
Constant Field Values

HP_UX

public static final int HP_UX
See Also:
Constant Field Values

AIX

public static final int AIX
See Also:
Constant Field Values

FREEBSD

public static final int FREEBSD
See Also:
Constant Field Values

IRIX

public static final int IRIX
See Also:
Constant Field Values

DIGITAL_UNIX

public static final int DIGITAL_UNIX
See Also:
Constant Field Values

NETWARE

public static final int NETWARE
See Also:
Constant Field Values

WINDOWS_NT

public static final int WINDOWS_NT
See Also:
Constant Field Values
Constructor Detail

HostProperties

public HostProperties()
Initialize the host properties.


HostProperties

public HostProperties(java.lang.String home,
                      java.lang.String vendor,
                      java.lang.String app)
Initialize host properties with specific relative application dir

If home != null, this will be returned as the User's home directory.

Method Detail

getBootVolumeName

public static java.lang.String getBootVolumeName()
Retrieve the boot volume name. Only works on Mac OS X, returns the empty string on all other platforms.


getHostPlatform

public static int getHostPlatform()
Retrieve general platform we are running on.


getHostOS

public static int getHostOS()
Retrieve the OS we're running ongeneral platform we are running on.


getLineSep

public static java.lang.String getLineSep()
Retrieve the line separation character string.


getDirSep

public static java.lang.String getDirSep()
Retrieve the directory separation character string.


getPathSep

public static java.lang.String getPathSep()
Retrieve the path separation character string.


getHostProperty

public static java.lang.String getHostProperty(java.lang.String name,
                                               java.lang.String dflt)
generic Property retrieval function


getUserHomeDir

public static java.lang.String getUserHomeDir()
Home directory


getCurrentDir

public static java.lang.String getCurrentDir()
Current Directory


getPreferencesDir

public static java.lang.String getPreferencesDir()
Default directories on several systems by platform. No trailing '/'!


getSupportDir

public static java.lang.String getSupportDir()
Default directories on several systems by platform. No trailing '/'!


getAppPreferencesDir

public static java.lang.String getAppPreferencesDir()
Default directories on several systems by platform. No trailing '/'!


getAppSupportDir

public static java.lang.String getAppSupportDir()
Default directories on several systems by platform. No trailing '/'!


getAppLogDir

public static java.lang.String getAppLogDir()
Default directories on several systems by platform. No trailing '/'!


getAppTmpDir

public static java.lang.String getAppTmpDir()
Default directories on several systems by platform. No trailing '/'!


getAppEncodingsDir

public static java.lang.String getAppEncodingsDir()
Default directories on several systems by platform. No trailing '/'!


getAppDTDsDir

public static java.lang.String getAppDTDsDir()
Default directories on several systems by platform. No trailing '/'!


getVendorPreferencesDir

public static java.lang.String getVendorPreferencesDir()
Default directories on several systems by platform. No trailing '/'!


getVendorSupportDir

public static java.lang.String getVendorSupportDir()
Default directories on several systems by platform. No trailing '/'!


getVendorLicensesDir

public static java.lang.String getVendorLicensesDir()
Default directories on several systems by platform. No trailing '/'!


getAppLicensesDir

public static java.lang.String getAppLicensesDir()
Default directories on several systems by platform. No trailing '/'!


logStatus

public static void logStatus()
Writes current properties to the log


getJREversion

public static int getJREversion()
Returns the JRE-version (as an int) that executes this program (we take only the first three tokens of the version-string into account).