spock.util.environment
public class OperatingSystem extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OperatingSystem.Family
An operating system family.
|
Modifier and Type | Method and Description |
---|---|
static OperatingSystem |
getCurrent()
Returns the current operating system.
|
OperatingSystem.Family |
getFamily()
Returns the family of the operating system.
|
String |
getName()
Returns the name of the operating system, as returned by the
os.name system property. |
String |
getVersion()
Returns the version of the operating system, as returned by the
os.version system property. |
boolean |
isLinux()
Tells whether the operating system family is Linux.
|
boolean |
isMacOs()
Tells whether the operating system family is Mac OS.
|
boolean |
isOther()
Tells whether the operating system family is anything other than those listed above.
|
boolean |
isSolaris()
Tells whether the operating system family is Solaris.
|
boolean |
isWindows()
Tells whether the operating system family is Windows.
|
public String getName()
os.name
system property.os.name
system propertypublic String getVersion()
os.version
system property.os.version
system propertypublic OperatingSystem.Family getFamily()
public boolean isLinux()
public boolean isMacOs()
public boolean isWindows()
public boolean isSolaris()
public boolean isOther()
public static OperatingSystem getCurrent()