Class OperatingSystem

java.lang.Object
com.globalmentor.java.OperatingSystem

public class OperatingSystem extends Object
Utilities for working with operating system-specific attributes.
Author:
Garret Wilson
  • Field Details

    • LINE_SEPARATOR_PROPERTY

      public static final String LINE_SEPARATOR_PROPERTY
      The property specifying the line separator character for the platform.
      See Also:
    • JAVA_IO_TMPDIR_PROPERTY

      public static final String JAVA_IO_TMPDIR_PROPERTY
      The temporary directory name.
      See Also:
    • OS_NAME_PROPERTY

      public static final String OS_NAME_PROPERTY
      The name of the operating system.
      See Also:
    • OS_ARCH_PROPERTY

      public static final String OS_ARCH_PROPERTY
      The operating system architecture.
      See Also:
    • OS_VERSION_PROPERTY

      public static final String OS_VERSION_PROPERTY
      The operating system version.
      See Also:
    • USER_NAME_PROPERTY

      public static final String USER_NAME_PROPERTY
      The user name property.
      See Also:
    • USER_HOME_PROPERTY

      public static final String USER_HOME_PROPERTY
      The property for the user's home directory.
      See Also:
    • USER_DIR_PROPERTY

      public static final String USER_DIR_PROPERTY
      The property for the user's current working directory.
      See Also:
    • WINDOWS

      public static final String WINDOWS
      The string, "windows", which is a case-insensitive substring of a Windows operating system identification string.
      See Also:
  • Constructor Details

    • OperatingSystem

      public OperatingSystem()
  • Method Details

    • getLineSeparator

      @Deprecated public static String getLineSeparator() throws SecurityException
      Deprecated.
      Returns the system line separator string.
      Returns:
      The the system line separator string.
      Throws:
      SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to this system property.
      See Also:
    • getUserHomeDirectory

      public static Path getUserHomeDirectory() throws SecurityException
      Returns the home directory of the user.
      Returns:
      The user home directory.
      Throws:
      SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to this system property.
      See Also:
    • getTempDirectory

      public static Path getTempDirectory() throws SecurityException
      Returns the system temporary directory
      Returns:
      The system temporary directory directory.
      Throws:
      SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to this system property.
      See Also:
    • getWorkingDirectory

      public static Path getWorkingDirectory() throws SecurityException
      Returns the current directory of the user.
      Returns:
      The user's current working directory.
      Throws:
      SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to this system property.
      See Also:
    • isWindowsOS

      public static boolean isWindowsOS()
      Returns:
      true if the operating system is a version of Windows.
      Throws:
      SecurityException - if a security manager exists and its checkPropertyAccess method doesn't allow access to this system property.
      See Also: