jodd.util
Class SystemUtil

java.lang.Object
  extended by jodd.util.SystemUtil

public class SystemUtil
extends java.lang.Object

Various system utilities.


Field Summary
static java.lang.String FILE_ENCODING
           
static java.lang.String HTTP_PROXY_HOST
           
static java.lang.String HTTP_PROXY_PASSWORD
           
static java.lang.String HTTP_PROXY_PORT
           
static java.lang.String HTTP_PROXY_USER
           
static java.lang.String JAVA_CLASSPATH
           
static java.lang.String JAVA_HOME
           
static java.lang.String JAVA_SPECIFICATION_VERSION
           
static java.lang.String JAVA_VENDOR
           
static java.lang.String JAVA_VERSION
           
static java.lang.String OS_NAME
           
static java.lang.String OS_VERSION
           
static java.lang.String PATH_SEPARATOR
           
static java.lang.String SUN_BOOT_CLASS_PATH
           
static java.lang.String TEMP_DIR
           
static java.lang.String USER_DIR
           
static java.lang.String USER_HOME
           
static java.lang.String USER_NAME
           
 
Constructor Summary
SystemUtil()
           
 
Method Summary
static java.lang.String getClassPath()
          Returns system class path.
static java.lang.String getFileEncoding()
          Returns file encoding.
static java.lang.String getJavaHome()
          Returns JAVA_HOME which is not equals to "java.home" property since it points to JAVA_HOME/jre folder.
static java.lang.String getJavaJreHome()
          Returns JRE home.
static double getJavaSpecificationVersion()
          Retrieves the version of the currently running JVM.
static java.lang.String getJavaVendor()
          Returns Java vendor.
static java.lang.String getJavaVersion()
          Returns Java version.
static java.lang.String getOsName()
          Returns OS name.
static java.lang.String getOsVersion()
          Returns OS version.
static java.lang.String getPathSeparator()
          Returns path separator.
static java.lang.String getSunBoothClassPath()
          Returns sun bootstrap class path.
static java.lang.String getTempDir()
          Returns system temp dir.
static java.lang.String getUserDir()
          Returns current working folder.
static java.lang.String getUserHome()
          Returns user home folder.
static java.lang.String getUserName()
          Returns current user.
static java.lang.String getWorkingFolder()
          Returns current working folder.
static boolean isAtLeastJdk15()
          Checks if the currently running JVM is at least compliant with JDK 1.5.
static boolean isAtLeastJdk16()
          Checks if the currently running JVM is at least compliant with JDK 1.6.
static boolean isHostAix()
          Returns true< if host is AIX.
static boolean isHostLinux()
          Returns true if host is Linux.
static boolean isHostMac()
          Returns true if host is Mac.
static boolean isHostSolaris()
          Returns true if host is Solaris.
static boolean isHostUnix()
          Returns true if host is a general unix.
static boolean isHostWindows()
          Returns true if host is Windows.
static void setHttpProxy(java.lang.String host, java.lang.String port)
          Sets HTTP proxy settings.
static void setHttpProxy(java.lang.String host, java.lang.String port, java.lang.String username, java.lang.String password)
          Sets HTTP proxy settings.
static double systemTimerResolution()
          Calculates and returns java system timer resolution in miliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_DIR

public static final java.lang.String USER_DIR
See Also:
Constant Field Values

USER_NAME

public static final java.lang.String USER_NAME
See Also:
Constant Field Values

USER_HOME

public static final java.lang.String USER_HOME
See Also:
Constant Field Values

JAVA_HOME

public static final java.lang.String JAVA_HOME
See Also:
Constant Field Values

TEMP_DIR

public static final java.lang.String TEMP_DIR
See Also:
Constant Field Values

OS_NAME

public static final java.lang.String OS_NAME
See Also:
Constant Field Values

OS_VERSION

public static final java.lang.String OS_VERSION
See Also:
Constant Field Values

JAVA_VERSION

public static final java.lang.String JAVA_VERSION
See Also:
Constant Field Values

JAVA_SPECIFICATION_VERSION

public static final java.lang.String JAVA_SPECIFICATION_VERSION
See Also:
Constant Field Values

JAVA_VENDOR

public static final java.lang.String JAVA_VENDOR
See Also:
Constant Field Values

JAVA_CLASSPATH

public static final java.lang.String JAVA_CLASSPATH
See Also:
Constant Field Values

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
See Also:
Constant Field Values

HTTP_PROXY_HOST

public static final java.lang.String HTTP_PROXY_HOST
See Also:
Constant Field Values

HTTP_PROXY_PORT

public static final java.lang.String HTTP_PROXY_PORT
See Also:
Constant Field Values

HTTP_PROXY_USER

public static final java.lang.String HTTP_PROXY_USER
See Also:
Constant Field Values

HTTP_PROXY_PASSWORD

public static final java.lang.String HTTP_PROXY_PASSWORD
See Also:
Constant Field Values

FILE_ENCODING

public static final java.lang.String FILE_ENCODING
See Also:
Constant Field Values

SUN_BOOT_CLASS_PATH

public static final java.lang.String SUN_BOOT_CLASS_PATH
See Also:
Constant Field Values
Constructor Detail

SystemUtil

public SystemUtil()
Method Detail

systemTimerResolution

public static double systemTimerResolution()
Calculates and returns java system timer resolution in miliseconds. Resolution of a timer depends on platform and java version.


getUserDir

public static java.lang.String getUserDir()
Returns current working folder.


getUserName

public static java.lang.String getUserName()
Returns current user.


getUserHome

public static java.lang.String getUserHome()
Returns user home folder.


getWorkingFolder

public static java.lang.String getWorkingFolder()
Returns current working folder. Just a better name for getUserDir().


getJavaJreHome

public static java.lang.String getJavaJreHome()
Returns JRE home.


getJavaHome

public static java.lang.String getJavaHome()
Returns JAVA_HOME which is not equals to "java.home" property since it points to JAVA_HOME/jre folder.


getTempDir

public static java.lang.String getTempDir()
Returns system temp dir.


getOsName

public static java.lang.String getOsName()
Returns OS name.


getOsVersion

public static java.lang.String getOsVersion()
Returns OS version.


getJavaVersion

public static java.lang.String getJavaVersion()
Returns Java version.

See Also:
getJavaSpecificationVersion()

getJavaSpecificationVersion

public static double getJavaSpecificationVersion()
Retrieves the version of the currently running JVM.


getJavaVendor

public static java.lang.String getJavaVendor()
Returns Java vendor.


getClassPath

public static java.lang.String getClassPath()
Returns system class path.


getPathSeparator

public static java.lang.String getPathSeparator()
Returns path separator.


getFileEncoding

public static java.lang.String getFileEncoding()
Returns file encoding.


isAtLeastJdk15

public static boolean isAtLeastJdk15()
Checks if the currently running JVM is at least compliant with JDK 1.5.


isAtLeastJdk16

public static boolean isAtLeastJdk16()
Checks if the currently running JVM is at least compliant with JDK 1.6.


isHostWindows

public static boolean isHostWindows()
Returns true if host is Windows.


isHostLinux

public static boolean isHostLinux()
Returns true if host is Linux.


isHostUnix

public static boolean isHostUnix()
Returns true if host is a general unix.


isHostMac

public static boolean isHostMac()
Returns true if host is Mac.


isHostSolaris

public static boolean isHostSolaris()
Returns true if host is Solaris.


isHostAix

public static boolean isHostAix()
Returns true< if host is AIX.


getSunBoothClassPath

public static java.lang.String getSunBoothClassPath()
Returns sun bootstrap class path.


setHttpProxy

public static void setHttpProxy(java.lang.String host,
                                java.lang.String port,
                                java.lang.String username,
                                java.lang.String password)
Sets HTTP proxy settings.


setHttpProxy

public static void setHttpProxy(java.lang.String host,
                                java.lang.String port)
Sets HTTP proxy settings.



Copyright © 2003-2012 Jodd Team