Package org.apache.commons.exec
Class OS
- java.lang.Object
-
- org.apache.commons.exec.OS
-
public final class OS extends java.lang.Object
Condition that tests the OS type.Copied and adapted from Apache Ant 1.9.6 from
org.apache.tools.ant.taskdefs.condition.OS.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFAMILY_9XOS family name to test: "win9x"static java.lang.StringFAMILY_DOSOS family name to test: "dos"static java.lang.StringFAMILY_MACOS family name to test: "mac"static java.lang.StringFAMILY_NETWAREOS family name to test: "netware"static java.lang.StringFAMILY_NTOS family name to test: "winnt"static java.lang.StringFAMILY_OS2OS family name to test: "os/2"static java.lang.StringFAMILY_OS400OS family name to test: "os/400"static java.lang.StringFAMILY_TANDEMOS family name to test: "tandem"static java.lang.StringFAMILY_UNIXOS family name to test: "unix"static java.lang.StringFAMILY_VMSOS family name to test: "openvms"static java.lang.StringFAMILY_WINDOWSOS family name to test: "windows"static java.lang.StringFAMILY_ZOSOS family name to test: "z/os"
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisArch(java.lang.String arch)Tests whether the OS on which commons-exec is executing matches the given OS architecture.static booleanisFamilyDOS()Tests whether the OS is in the DOS family.static booleanisFamilyMac()Tests whether the OS is in the Mac family.static booleanisFamilyNetware()Tests whether the OS is in the Netware family.static booleanisFamilyOpenVms()Tests whether the OS is in the OpenVMS family.static booleanisFamilyOS2()Tests whether the OS is in the OS/2 family.static booleanisFamilyOS400()Tests whether the OS is in the OS/400 family.static booleanisFamilyTandem()Tests whether the OS is in the Tandem family.static booleanisFamilyUnix()Tests whether the OS is in the Unix family.static booleanisFamilyWin9x()Tests whether the OS is in the Windows 9x family.static booleanisFamilyWindows()Tests whether the OS is in the Windows family.static booleanisFamilyWinNT()Tests whether the OS is in the Windows NT family.static booleanisFamilyZOS()Tests whether the OS is in the z/OS family.static booleanisName(java.lang.String name)Tests whether if the OS on which commons-exec is executing matches the given OS name.static booleanisOs(java.lang.String family, java.lang.String name, java.lang.String arch, java.lang.String version)Tests whether the OS on which commons-exec is executing matches the given OS family, name, architecture and version.static booleanisVersion(java.lang.String version)Tests whether the OS on which commons-exec is executing matches the given OS version.
-
-
-
Field Detail
-
FAMILY_9X
public static final java.lang.String FAMILY_9X
OS family name to test: "win9x"- See Also:
- Constant Field Values
-
FAMILY_DOS
public static final java.lang.String FAMILY_DOS
OS family name to test: "dos"- See Also:
- Constant Field Values
-
FAMILY_MAC
public static final java.lang.String FAMILY_MAC
OS family name to test: "mac"- See Also:
- Constant Field Values
-
FAMILY_NETWARE
public static final java.lang.String FAMILY_NETWARE
OS family name to test: "netware"- See Also:
- Constant Field Values
-
FAMILY_NT
public static final java.lang.String FAMILY_NT
OS family name to test: "winnt"- See Also:
- Constant Field Values
-
FAMILY_OS2
public static final java.lang.String FAMILY_OS2
OS family name to test: "os/2"- See Also:
- Constant Field Values
-
FAMILY_OS400
public static final java.lang.String FAMILY_OS400
OS family name to test: "os/400"- See Also:
- Constant Field Values
-
FAMILY_TANDEM
public static final java.lang.String FAMILY_TANDEM
OS family name to test: "tandem"- See Also:
- Constant Field Values
-
FAMILY_UNIX
public static final java.lang.String FAMILY_UNIX
OS family name to test: "unix"- See Also:
- Constant Field Values
-
FAMILY_VMS
public static final java.lang.String FAMILY_VMS
OS family name to test: "openvms"- See Also:
- Constant Field Values
-
FAMILY_WINDOWS
public static final java.lang.String FAMILY_WINDOWS
OS family name to test: "windows"- See Also:
- Constant Field Values
-
FAMILY_ZOS
public static final java.lang.String FAMILY_ZOS
OS family name to test: "z/os"- See Also:
- Constant Field Values
-
-
Method Detail
-
isArch
public static boolean isArch(java.lang.String arch)
Tests whether the OS on which commons-exec is executing matches the given OS architecture.- Parameters:
arch- the OS architecture to check for.- Returns:
- whether if the OS matches.
-
isFamilyDOS
public static boolean isFamilyDOS()
Tests whether the OS is in the DOS family.- Returns:
- whether the OS is in the DOS family.
-
isFamilyMac
public static boolean isFamilyMac()
Tests whether the OS is in the Mac family.- Returns:
- whether the OS is in the Mac family.
-
isFamilyNetware
public static boolean isFamilyNetware()
Tests whether the OS is in the Netware family.- Returns:
- whether the OS is in the Netware family.
-
isFamilyOpenVms
public static boolean isFamilyOpenVms()
Tests whether the OS is in the OpenVMS family.- Returns:
- whether the OS is in the OpenVMS family.
-
isFamilyOS2
public static boolean isFamilyOS2()
Tests whether the OS is in the OS/2 family.- Returns:
- whether the OS is in the OS/2 family.
-
isFamilyOS400
public static boolean isFamilyOS400()
Tests whether the OS is in the OS/400 family.- Returns:
- whether the OS is in the OS/400 family.
-
isFamilyTandem
public static boolean isFamilyTandem()
Tests whether the OS is in the Tandem family.- Returns:
- whether the OS is in the Tandem family.
-
isFamilyUnix
public static boolean isFamilyUnix()
Tests whether the OS is in the Unix family.- Returns:
- whether the OS is in the Unix family.
-
isFamilyWin9x
public static boolean isFamilyWin9x()
Tests whether the OS is in the Windows 9x family.- Returns:
- whether the OS is in the Windows 9x family.
-
isFamilyWindows
public static boolean isFamilyWindows()
Tests whether the OS is in the Windows family.- Returns:
- whether the OS is in the Windows family.
-
isFamilyWinNT
public static boolean isFamilyWinNT()
Tests whether the OS is in the Windows NT family.- Returns:
- whether the OS is in the Windows NT family.
-
isFamilyZOS
public static boolean isFamilyZOS()
Tests whether the OS is in the z/OS family.- Returns:
- whether the OS is in the z/OS family.
-
isName
public static boolean isName(java.lang.String name)
Tests whether if the OS on which commons-exec is executing matches the given OS name.- Parameters:
name- the OS name to check for.- Returns:
- whether the OS matches.
-
isOs
public static boolean isOs(java.lang.String family, java.lang.String name, java.lang.String arch, java.lang.String version)
Tests whether the OS on which commons-exec is executing matches the given OS family, name, architecture and version.- Parameters:
family- The OS family.name- The OS name.arch- The OS architecture.version- The OS version.- Returns:
- whether the OS matches.
-
isVersion
public static boolean isVersion(java.lang.String version)
Tests whether the OS on which commons-exec is executing matches the given OS version.- Parameters:
version- the OS version to check for.- Returns:
- whether if the OS matches.
-
-