Package org.apache.maven.shared.utils
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
Modifier and TypeFieldDescriptionstatic final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
OS family that can be tested for.static final String
system line separator , e.g.static final String
The OA architecture.static final String
OS Familystatic final String
The OS Name.static final String
The OS version.static final String
The path separator. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe set of valid families.static boolean
Determines if the OS on which Ant is executing matches the given OS architecture.static boolean
Determines if the OS on which Ant is executing matches the given OS family.static boolean
Determines if the OS on which Ant is executing matches the given OS name.static boolean
isValidFamily
(String family) Test if the given family String represents a valid Familystatic boolean
Determines 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
OS family that can be tested for. "windows"- See Also:
-
FAMILY_WIN9X
OS family that can be tested for. "win9x"- See Also:
-
FAMILY_NT
OS family that can be tested for. "winnt"- See Also:
-
FAMILY_OS2
OS family that can be tested for. "os/2"- See Also:
-
FAMILY_NETWARE
OS family that can be tested for. "netware"- See Also:
-
FAMILY_DOS
OS family that can be tested for. "dos"- See Also:
-
FAMILY_MAC
OS family that can be tested for. "mac"- See Also:
-
FAMILY_TANDEM
OS family that can be tested for. "tandem"- See Also:
-
FAMILY_UNIX
OS family that can be tested for. "unix"- See Also:
-
FAMILY_OPENVMS
OS family that can be tested for. "openvms"- See Also:
-
FAMILY_ZOS
OS family that can be tested for. "z/os"- See Also:
-
FAMILY_OS400
OS family that can be tested for. "os/400"- See Also:
-
-
Constructor Details
-
Os
public Os()Default constructor -
Os
Constructor that sets the family attribute- Parameters:
family
- a String value
-
-
Method Details
-
getValidFamilies
The set of valid families. This methods initializes the set until VALID_FAMILIES constant is set.- Returns:
- The set of families.
-
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:
true
if 'family' represents a valid OS-Family,false
otherwise.
-