Class Os
java.lang.Object
org.apache.maven.shared.utils.Os
Condition that tests the OS type.
This class got copied over from Apache ANT. Even the version from plexus-utils was only an ANT fork! The last time it got copied was on 2011-08-12
When merging changes please take care of the special OS_FAMILY handling in this version of Os.java!
- Author:
- Stefan Bodewig, Magesh Umasankar, Brian Fox, Mark Struberg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final StringOS family that can be tested for.static final Stringsystem line separator , e.g.static final StringThe OA architecture.static final StringOS Familystatic final StringThe OS Name.static final StringThe OS version.static final StringThe path separator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe set of valid families.static booleanDetermines if the OS on which Ant is executing matches the given OS architecture.static booleanDetermines if the OS on which Ant is executing matches the given OS family.static booleanDetermines if the OS on which Ant is executing matches the given OS name.static booleanisValidFamily(String family) Test if the given family String represents a valid Familystatic booleanDetermines if the OS on which Ant is executing matches the given OS version.
-
Field Details
-
OS_NAME
The OS Name. -
OS_ARCH
The OA architecture. -
OS_VERSION
The OS version. -
PATH_SEP
The path separator. -
LINE_SEP
system line separator , e.g. "\n" on unixoid systems and "\r\n" on Windows -
OS_FAMILY
OS Family -
FAMILY_WINDOWS
-
FAMILY_WIN9X
-
FAMILY_NT
-
FAMILY_OS2
-
FAMILY_NETWARE
-
FAMILY_DOS
-
FAMILY_MAC
-
FAMILY_TANDEM
-
FAMILY_UNIX
-
FAMILY_OPENVMS
-
FAMILY_ZOS
-
FAMILY_OS400
-
-
Constructor Details
-
Os
public Os()Default constructor -
Os
Constructor that sets the family attribute- Parameters:
family- a String value
-
-
Method Details
-
getValidFamilies
-
isFamily
Determines if the OS on which Ant is executing matches the given OS family.- Parameters:
family- the family to check for- Returns:
- true if the OS matches
-
isName
Determines if the OS on which Ant is executing matches the given OS name.- Parameters:
name- the OS name to check for- Returns:
- true if the OS matches
-
isArch
Determines if the OS on which Ant is executing matches the given OS architecture.- Parameters:
arch- the OS architecture to check for- Returns:
- true if the OS matches
-
isVersion
Determines if the OS on which Ant is executing matches the given OS version.- Parameters:
version- the OS version to check for- Returns:
- true if the OS matches
-
isValidFamily
Test if the given family String represents a valid Family- Parameters:
family- the os family- Returns:
trueif 'family' represents a valid OS-Family,falseotherwise.
-