Package org.codehaus.plexus.util
Class Os
java.lang.Object
org.codehaus.plexus.util.Os
Condition that tests the OS type.
- Since:
- 1.0
- Author:
- Stefan Bodewig, Magesh Umasankar, Brian Fox
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleaneval()static booleanDetermines if the current OS matches the given OS architecture.static booleanDetermines if the current OS matches the given OS family.static booleanDetermines if the current OS matches the given OS name.static booleanDetermines if the current OS matches the given OS family, name, architecture and version.static booleanisValidFamily(String theFamily) Helper method to check if the given family is in the following list: dos mac netware os/2 tandem unix windows win9x z/os os/400 openvmsstatic booleanDetermines if the current OS matches the given OS version.voidSets the desired OS architecturevoidSets the desired OS family typevoidSets the desired OS namevoidsetVersion(String version) Sets the desired OS version
- 
Field Details- 
FAMILY_DOS- See Also:
 
- 
FAMILY_MAC- See Also:
 
- 
FAMILY_NETWARE- See Also:
 
- 
FAMILY_OS2- See Also:
 
- 
FAMILY_TANDEM- See Also:
 
- 
FAMILY_UNIX- See Also:
 
- 
FAMILY_WINDOWS- See Also:
 
- 
FAMILY_WIN9X- See Also:
 
- 
FAMILY_ZOS- See Also:
 
- 
FAMILY_OS400- See Also:
 
- 
FAMILY_OPENVMS- See Also:
 
- 
OS_NAME
- 
OS_ARCH
- 
OS_VERSION
- 
OS_FAMILY
 
- 
- 
Constructor Details- 
Ospublic Os()Default constructor
- 
OsConstructor that sets the family attribute- Parameters:
- family- a String value
 
 
- 
- 
Method Details- 
setFamilySets the desired OS family type- Parameters:
- f- The OS family type desired
 Possible values:- dos
- mac
- netware
- os/2
- tandem
- unix
- windows
- win9x
- z/os
- os/400
- openvms
 
 
- 
setNameSets the desired OS name- Parameters:
- name- The OS name
 
- 
setArchSets the desired OS architecture- Parameters:
- arch- The OS architecture
 
- 
setVersionSets the desired OS version- Parameters:
- version- The OS version
 
- 
eval- Returns:
- Determines if the current OS matches the type of that set in setFamily.
- Throws:
- Exception- any errir
- See Also:
 
- 
isFamilyDetermines if the current OS matches the given OS family.- Parameters:
- family- the family to check for
- Returns:
- true if the OS matches
- Since:
- 1.0
 
- 
isNameDetermines if the current OS matches the given OS name.- Parameters:
- name- the OS name to check for
- Returns:
- true if the OS matches
- Since:
- 1.0
 
- 
isArchDetermines if the current OS matches the given OS architecture.- Parameters:
- arch- the OS architecture to check for
- Returns:
- true if the OS matches
- Since:
- 1.0
 
- 
isVersionDetermines if the current OS matches the given OS version.- Parameters:
- version- the OS version to check for
- Returns:
- true if the OS matches
- Since:
- 1.0
 
- 
isOsDetermines if the current OS matches the given OS family, name, architecture and version. The name, architecture and version are compared to the System properties os.name, os.version and os.arch in a case-independent way.- Parameters:
- family- The OS family
- name- The OS name
- arch- The OS architecture
- version- The OS version
- Returns:
- true if the OS matches
- Since:
- 1.0
 
- 
isValidFamilyHelper method to check if the given family is in the following list:- dos
- mac
- netware
- os/2
- tandem
- unix
- windows
- win9x
- z/os
- os/400
- openvms
 - Parameters:
- theFamily- the family to check.
- Returns:
- true if one of the valid families.
- Since:
- 1.4.2
 
- 
getValidFamilies- Returns:
- a copy of the valid families
- Since:
- 1.4.2
 
 
-