Enum OperatingSystem

    • 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
      • getIdentificationType

        @Pure
        public static OperatingSystemIdentificationType getIdentificationType()
        Replies the type of identification found on this operating system.
        Returns:
        the type of identification found on this operating system.
      • isCurrentOS

        @Pure
        public boolean isCurrentOS()
        Replies if the current OperatingSystem constant is corresponding to the current operating system.
        Returns:
        true if the current operating system corresponds to this constant, otherwise false
      • isUnixCompliant

        @Pure
        public boolean isUnixCompliant()
        Replies of this OS is Unix compliant.
        Returns:
        true if this constant corresponds to a Unix-like operating system, otherwise false
      • getCurrentOSVersion

        @Pure
        public static String getCurrentOSVersion()
        Replies the version of the current OS.
        Returns:
        the version of the current operating system.
        See Also:
        System.getProperty(java.lang.String)
      • setCurrentOS

        public static void setCurrentOS​(OperatingSystem os)
        Force the type of the current OS replied by the functions of this class.

        If the given OS is null, the current OS will be auto-detected at the next call of getCurrentOS().

        Parameters:
        os - - the OS to consider for the next calls to getCurrentOS().
        Since:
        12.0
      • getCurrentOS

        @Pure
        public static OperatingSystem getCurrentOS()
        Replies the current operating system.
        Returns:
        the current operating system constant.
      • getOperatingSystemArchitectureDataModel

        @Pure
        public static int getOperatingSystemArchitectureDataModel()
        Replies the data model of the current operating system: 32 or 64 bits.
        Returns:
        the integer which is corresponding to the data model, or 0 if it could not be determined.
      • is64BitOperatingSystem

        @Pure
        public static boolean is64BitOperatingSystem()
        Replies if the current operating system is 64bit.
        Returns:
        true if the operating system is 64bits, othewise false
      • is32BitOperatingSystem

        @Pure
        public static boolean is32BitOperatingSystem()
        Replies if the current operating system is 32bit.
        Returns:
        true if the operating system is 32bits, othewise false
      • getOSSerialNumber

        @Pure
        public static String getOSSerialNumber()
        Get the OS serial number.

        This function does not allow to run any system command with the super-user rights, and it disable any additional GUI.

        Returns:
        the serial number associated to the current operating system.
      • getOSSerialNumber

        @Pure
        public static String getOSSerialNumber​(boolean enableSuperUser,
                                               boolean enableGUI)
        Get the OS serial number.
        Parameters:
        enableSuperUser - indicates if the super-user commands are enabled or not.
        enableGUI - indicates if any additional GUI could be opened, or not.
        Returns:
        the serial number associated to the current operating system.
        Since:
        6.1
      • getOSUUID

        @Pure
        public static String getOSUUID()
        Get the OS UUID.

        This function does not allow to run any system command with the super-user rights, and it disable any additional GUI.

        Returns:
        an unique identifier for the current operating system.
      • getOSUUID

        @Pure
        public static String getOSUUID​(boolean enableSuperUser,
                                       boolean enableGUI)
        Get the OS UUID.
        Parameters:
        enableSuperUser - indicates if the super-user commands are enabled or not.
        enableGUI - indicates if any additional GUI could be opened, or not.
        Returns:
        an unique identifier for the current operating system.
        Since:
        6.1