Class OSUtil
- java.lang.Object
-
- com.github.toolarium.system.command.util.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 timestampjava.lang.String
getHostname()
Get the hostnamestatic OSUtil
getInstance()
Get the instancejava.lang.String
getOSArchitecture()
Get the operating system architectureOSUtil.OSType
getOSType()
Get the operating systemboolean
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 jurisdictionboolean
isWDL()
Check is it is a window wsl environmentboolean
isWindows()
Check if the underlying operating system is a windows os.
-
-
-
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
-
-