Class OSUtil


  • public final class OSUtil
    extends java.lang.Object
    OS util
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  OSUtil.OSType
      Define the OS types
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCreationTimestamp​(java.nio.file.Path path)
      Get the timestamp
      java.lang.String getHostname()
      Get the hostname
      static OSUtil getInstance()
      Get the instance
      java.lang.String getOSArchitecture()
      Get the operating system architecture
      OSUtil.OSType getOSType()
      Get the operating system
      boolean isBSD()
      Check if the underlying operating system is a freebsd os.
      boolean isLinux()
      Check if the underlying operating system is a linux os.
      boolean isMac()
      Check if the underlying operating system is a linux os.
      boolean isSolaris()
      Check if the underlying operating system is a solaris os.
      boolean isUnix()
      Check if the underlying operating system is a unix os.
      boolean isUnlimitedJurisdiction()
      Check if there is unlimited jurisdiction
      boolean isWDL()
      Check is it is a window wsl environment
      boolean isWindows()
      Check if the underlying operating system is a windows os.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static OSUtil getInstance()
        Get the instance
        Returns:
        the instance
      • getOSType

        public OSUtil.OSType getOSType()
        Get the operating system
        Returns:
        the operating system
      • isLinux

        public boolean isLinux()
        Check if the underlying operating system is a linux os.
        Returns:
        true if it is linux
      • isMac

        public boolean isMac()
        Check if the underlying operating system is a linux os.
        Returns:
        true if it is linux
      • isUnix

        public boolean isUnix()
        Check if the underlying operating system is a unix os.
        Returns:
        true if it is unix
      • isBSD

        public boolean isBSD()
        Check if the underlying operating system is a freebsd os.
        Returns:
        true if it is freebsd
      • isSolaris

        public boolean isSolaris()
        Check if the underlying operating system is a solaris os.
        Returns:
        true if it is solaris
      • isWindows

        public boolean isWindows()
        Check if the underlying operating system is a windows os.
        Returns:
        true if it is windows
      • isWDL

        public boolean isWDL()
        Check is it is a window wsl environment
        Returns:
        if it is a window wsl environment
      • getOSArchitecture

        public java.lang.String getOSArchitecture()
        Get the operating system architecture
        Returns:
        the operating system architecture
      • getCreationTimestamp

        public long getCreationTimestamp​(java.nio.file.Path path)
        Get the timestamp
        Parameters:
        path - the path
        Returns:
        the timestamp
      • getHostname

        public java.lang.String getHostname()
        Get the hostname
        Returns:
        the hostname
      • isUnlimitedJurisdiction

        public boolean isUnlimitedJurisdiction()
        Check if there is unlimited jurisdiction
        Returns:
        true if there is unlimited jurisdiction