de.esprit.common.util

## Class OsUtil

- java.lang.Object
- - de.esprit.common.util.OsUtil

- All Implemented Interfaces:
    SysProps

      public class OsUtil
      extends java.lang.Object
      implements SysProps

  This class provides helper methods for dealing with platform specific information
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from interface de.esprit.common.util.SysProps

      `FILE_SEPARATOR, JAVA_CLASS_PATH, JAVA_ENDORSED_DIRS, JAVA_HOME, JAVA_IO_TMPDIR, JAVA_RUNTIME_NAME, JAVA_RUNTIME_VERSION, JAVA_SPECIFICATION_VERSION, JAVA_VERSION, JAVA_VM_NAME, LINE_SEPARATOR, OS_ARCH, OS_NAME, OS_VERSION, PATH_SEPARATOR, SUN_ARCH_DATA_MODEL, SUN_AWT_EXCEPTION_HANDLER, USER_DIR, USER_HOME, USER_NAME`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `exitSystem(int exitCode)` Provides a central places for calling System.exit(exitCode);
    `static java.lang.String` | `getFileSeparator()`
    `static java.lang.String` | `getHostName()`
    `static java.util.List<java.lang.String>` | `getJavaClassPath()`
    `static java.io.File` | `getJavaHome()`
    `static int` | `getJavaMajorVersion()`
    `static int` | `getJavaMajorVersion(java.lang.String versionStr)` Extracts the major version number from the given version string
    `static int` | `getJavaMinorVersion()`
    `static int` | `getJavaMinorVersion(java.lang.String versionStr)` Extracts the minor version number from the given version string
    `static java.lang.String` | `getJavaVersion()` Returns the version of the currently running Java VM as defined by the system property 'java.version'.
    `static java.lang.String` | `getJavaVMBitModel()` Tells the value of the system-property 'sun.arch.data.model' (typically 32 of 64 bit address)
    `static java.lang.String` | `getLineSeparator()`
    `static OsArchitecture` | `getOsArchitecture()` Returns the architecture of the underlying operation system.
    `static java.lang.String` | `getOsName()` Returns the OS-Name as read from the system-property 'os.name'
    `static OsType` | `getOsType()` Returns the OS-Type of the current platform.
    `static java.lang.String` | `getOsVersion()` Returns the OS-Version as read from the system-property 'os.version'
    `static java.lang.String` | `getPathSeparator()`
    `static OsType[]` | `getSupportedOsTypes()` Tells which `OsType`s are supported by this framework.
    `static java.io.File` | `getTempDir()`
    `static java.io.File` | `getUserHome()`
    `static java.lang.String` | `getUserName()` Returns the OS-login-name of the user as defined by the system property 'user.name'.
    `static java.io.File` | `getUserWorkingDir()`
    `static boolean` | `isHeadless()` Returns true if this system does NOT have a graphical environment
    `static boolean` | `isUnix()` Tells whether the current platform is a UNIX system
    `static boolean` | `isWindows()` Tells whether the current platform is a WINDOWS system
    `static void` | `setTempDir(java.io.File tmpDir)`
    `static void` | `setTempDir(java.lang.String dirName)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isHeadless

          public static boolean isHeadless()

      Returns true if this system does NOT have a graphical environment

    - #### getJavaMajorVersion

          public static int getJavaMajorVersion()

    - #### getJavaMinorVersion

          public static int getJavaMinorVersion()

    - #### getJavaMajorVersion

          public static int getJavaMajorVersion(java.lang.String versionStr)

      Extracts the major version number from the given version string

    - #### getJavaMinorVersion

          public static int getJavaMinorVersion(java.lang.String versionStr)

      Extracts the minor version number from the given version string

    - #### getOsArchitecture

          public static OsArchitecture getOsArchitecture()

      Returns the architecture of the underlying operation system.

    - #### getJavaVersion

          public static java.lang.String getJavaVersion()

      Returns the version of the currently running Java VM as defined by the system property 'java.version'.

    - #### getOsName

          public static java.lang.String getOsName()

      Returns the OS-Name as read from the system-property 'os.name'

    - #### getOsVersion

          public static java.lang.String getOsVersion()

      Returns the OS-Version as read from the system-property 'os.version'

    - #### getJavaVMBitModel

          public static java.lang.String getJavaVMBitModel()

      Tells the value of the system-property 'sun.arch.data.model' (typically 32 of 64 bit address)

    - #### getUserName

          public static java.lang.String getUserName()

      Returns the OS-login-name of the user as defined by the system property 'user.name'.

    - #### getOsType

          public static OsType getOsType()

      Returns the OS-Type of the current platform. Must be one of the supported OS-Types defined in `OsType`.

    - #### getSupportedOsTypes

          public static OsType[] getSupportedOsTypes()

      Tells which `OsType`s are supported by this framework.

    - #### isWindows

          public static boolean isWindows()

      Tells whether the current platform is a WINDOWS system

    - #### isUnix

          public static boolean isUnix()

      Tells whether the current platform is a UNIX system

    - #### getTempDir

          public static java.io.File getTempDir()

    - #### setTempDir

          public static void setTempDir(java.io.File tmpDir)

    - #### setTempDir

          public static void setTempDir(java.lang.String dirName)

    - #### getLineSeparator

          public static java.lang.String getLineSeparator()

    - #### getFileSeparator

          public static java.lang.String getFileSeparator()

    - #### getPathSeparator

          public static java.lang.String getPathSeparator()

    - #### getJavaHome

          public static java.io.File getJavaHome()

    - #### getUserHome

          public static java.io.File getUserHome()

    - #### getUserWorkingDir

          public static java.io.File getUserWorkingDir()

    - #### getHostName

          public static java.lang.String getHostName()

    - #### getJavaClassPath

          public static java.util.List<java.lang.String> getJavaClassPath()

    - #### exitSystem

          public static void exitSystem(int exitCode)

      Provides a central places for calling System.exit(exitCode);

Copyright © 2014 EsprIT-Systems. All Rights Reserved.