Class Os
java.lang.Object
org.apache.tools.ant.taskdefs.condition.Os
- All Implemented Interfaces:
Condition
Condition that tests the OS type.
- Since:
- Ant 1.4
-
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. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
eval()
Determines if the OS on which Ant is executing matches the type of that set in setFamily.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
Determines if the OS on which Ant is executing matches the given OS family, name, architecture and versionstatic boolean
Determines if the OS on which Ant is executing matches the given OS version.void
Sets the desired OS architecturevoid
Sets the desired OS family typevoid
Sets the desired OS namevoid
setVersion
(String version) Sets the desired OS version
-
Field Details
-
FAMILY_WINDOWS
OS family that can be tested for. "windows"- See Also:
-
FAMILY_9X
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_VMS
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
-
setFamily
Sets the desired OS family type- Parameters:
f
- The OS family type desiredPossible values:
- dos
- mac
- netware
- os/2
- tandem
- unix
- windows
- win9x
- z/os
- os/400
-
setName
Sets the desired OS name- Parameters:
name
- The OS name
-
setArch
Sets the desired OS architecture- Parameters:
arch
- The OS architecture
-
setVersion
Sets the desired OS version- Parameters:
version
- The OS version
-
eval
Determines if the OS on which Ant is executing matches the type of that set in setFamily.- Specified by:
eval
in interfaceCondition
- Returns:
- true if the os matches.
- Throws:
BuildException
- if there is an error.- See Also:
-
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
- Since:
- 1.5
-
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
- Since:
- 1.7
-
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
- Since:
- 1.7
-
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
- Since:
- 1.7
-
isOs
Determines if the OS on which Ant is executing matches the given OS family, name, architecture and version- Parameters:
family
- The OS familyname
- The OS namearch
- The OS architectureversion
- The OS version- Returns:
- true if the OS matches
- Since:
- 1.7
-