Class OSUtil
- java.lang.Object
-
- com.github.toolarium.system.command.util.OSUtil
-
public final class OSUtil extends java.lang.ObjectOS util
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOSUtil.OSTypeDefine the OS types
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCreationTimestamp(java.nio.file.Path path)Get the timestampjava.lang.StringgetHostname()Get the hostnamestatic OSUtilgetInstance()Get the instancejava.lang.StringgetOSArchitecture()Get the operating system architectureOSUtil.OSTypegetOSType()Get the operating systembooleanisBSD()Check if the underlying operating system is a freebsd os.booleanisLinux()Check if the underlying operating system is a linux os.booleanisMac()Check if the underlying operating system is a linux os.booleanisSolaris()Check if the underlying operating system is a solaris os.booleanisUnix()Check if the underlying operating system is a unix os.booleanisUnlimitedJurisdiction()Check if there is unlimited jurisdictionbooleanisWDL()Check is it is a window wsl environmentbooleanisWindows()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
-
-