Enum OperatingSystem

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AIX
      The value indicating the AIX operating system.
      FREEBSD
      The value indicating the FreeBSD operating system.
      HPUX
      The value indicating the HP-UX operating system.
      LINUX
      The value indicating the Linux operating system.
      MACOSX
      The value indicating the Mac OS X operating system.
      SOLARIS
      The value indicating the Solaris operating system.
      UNKNOWN
      The value indicating an unknown operating system.
      WINDOWS
      The value indicating the Windows operating system.
      WINDOWS_SERVER_2008
      The value indicating the Windows Server 2008 operating system.
      WINDOWS_VISTA
      The value indicating the Windows Vista operating system.
      WINDOWS7
      The value indicating the Windows 7 operating system.
      ZOS
      The value indicating the z/OS operating system.
    • Enum Constant Detail

      • AIX

        public static final OperatingSystem AIX
        The value indicating the AIX operating system.
      • FREEBSD

        public static final OperatingSystem FREEBSD
        The value indicating the FreeBSD operating system.
      • HPUX

        public static final OperatingSystem HPUX
        The value indicating the HP-UX operating system.
      • LINUX

        public static final OperatingSystem LINUX
        The value indicating the Linux operating system.
      • MACOSX

        public static final OperatingSystem MACOSX
        The value indicating the Mac OS X operating system.
      • SOLARIS

        public static final OperatingSystem SOLARIS
        The value indicating the Solaris operating system.
      • WINDOWS

        public static final OperatingSystem WINDOWS
        The value indicating the Windows operating system.
      • WINDOWS7

        public static final OperatingSystem WINDOWS7
        The value indicating the Windows 7 operating system.
      • WINDOWS_VISTA

        public static final OperatingSystem WINDOWS_VISTA
        The value indicating the Windows Vista operating system.
      • WINDOWS_SERVER_2008

        public static final OperatingSystem WINDOWS_SERVER_2008
        The value indicating the Windows Server 2008 operating system.
      • ZOS

        public static final OperatingSystem ZOS
        The value indicating the z/OS operating system.
      • UNKNOWN

        public static final OperatingSystem UNKNOWN
        The value indicating an unknown operating system.
    • Method Detail

      • values

        public static OperatingSystem[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OperatingSystem c : OperatingSystem.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OperatingSystem valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • toString

        public String toString()
        Retrieves the human-readable name of this operating system.
        Overrides:
        toString in class Enum<OperatingSystem>
        Returns:
        The human-readable name for this operating system.
      • forName

        public static OperatingSystem forName​(String osName)
        Retrieves the operating system for the provided name.
        Parameters:
        osName - The name for which to retrieve the corresponding operating system.
        Returns:
        The operating system for the provided name.
      • getOperatingSystem

        public static OperatingSystem getOperatingSystem()
        Returns the operating system on which the JVM is running.
        Returns:
        The operating system on which the JVM is running
      • isWindows

        public static boolean isWindows()
        Indicates whether the underlying operating system is a Windows variant.
        Returns:
        true if the underlying operating system is a Windows variant, or false if not.
      • isVista

        public static boolean isVista()
        Indicates whether the underlying operating system is Windows Vista.
        Returns:
        true if the underlying operating system is Windows Vista, or false if not.
      • isWindows2008

        public static boolean isWindows2008()
        Indicates whether the underlying operating system is Windows 2008.
        Returns:
        true if the underlying operating system is Windows 2008, or false if not.
      • isWindows7

        public static boolean isWindows7()
        Indicates whether the underlying operating system is Windows 7.
        Returns:
        true if the underlying operating system is Windows 7, or false if not.
      • isMacOS

        public static boolean isMacOS()
        Returns true if we are running under Mac OS and false otherwise.
        Returns:
        true if we are running under Mac OS and false otherwise.
      • isUnix

        public static boolean isUnix()
        Returns true if we are running under Unix and false otherwise.
        Returns:
        true if we are running under Unix and false otherwise.
      • isUnixBased

        public static boolean isUnixBased()
        Returns true if the OS is Unix based.
        Returns:
        true if the OS is Unix based.
      • isUnknown

        public static boolean isUnknown()
        Returns true if the OS is Unknown.
        Returns:
        true if the OS is Unknown.
      • hasUAC

        public static boolean hasUAC()
        Indicates whether the underlying operating system has UAC (User Access Control).
        Returns:
        true if the underlying operating system has UAC (User Access Control), or false if not.