public class Os
extends java.lang.Object
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!
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FAMILY_DOS
OS family that can be tested for.
|
static java.lang.String |
FAMILY_MAC
OS family that can be tested for.
|
static java.lang.String |
FAMILY_NETWARE
OS family that can be tested for.
|
static java.lang.String |
FAMILY_NT
OS family that can be tested for.
|
static java.lang.String |
FAMILY_OPENVMS
OS family that can be tested for.
|
static java.lang.String |
FAMILY_OS2
OS family that can be tested for.
|
static java.lang.String |
FAMILY_OS400
OS family that can be tested for.
|
static java.lang.String |
FAMILY_TANDEM
OS family that can be tested for.
|
static java.lang.String |
FAMILY_UNIX
OS family that can be tested for.
|
static java.lang.String |
FAMILY_WIN9X
OS family that can be tested for.
|
static java.lang.String |
FAMILY_WINDOWS
OS family that can be tested for.
|
static java.lang.String |
FAMILY_ZOS
OS family that can be tested for.
|
static java.lang.String |
LINE_SEP
system line separator , e.g.
|
static java.lang.String |
OS_ARCH |
static java.lang.String |
OS_FAMILY |
static java.lang.String |
OS_NAME |
static java.lang.String |
OS_VERSION |
static java.lang.String |
PATH_SEP |
Constructor and Description |
---|
Os()
Default constructor
|
Os(java.lang.String family)
Constructor that sets the family attribute
|
Modifier and Type | Method and Description |
---|---|
static java.util.Set<java.lang.String> |
getValidFamilies()
The set of valid families.
|
static boolean |
isArch(java.lang.String arch)
Determines if the OS on which Ant is executing matches the
given OS architecture.
|
static boolean |
isFamily(java.lang.String family)
Determines if the OS on which Ant is executing matches the
given OS family.
|
static boolean |
isName(java.lang.String name)
Determines if the OS on which Ant is executing matches the
given OS name.
|
static boolean |
isValidFamily(java.lang.String family)
Test if the given family String represents a valid Family
|
static boolean |
isVersion(java.lang.String version)
Determines if the OS on which Ant is executing matches the
given OS version.
|
public static final java.lang.String OS_NAME
public static final java.lang.String OS_ARCH
public static final java.lang.String OS_VERSION
public static final java.lang.String PATH_SEP
public static final java.lang.String LINE_SEP
public static final java.lang.String OS_FAMILY
public static final java.lang.String FAMILY_WINDOWS
public static final java.lang.String FAMILY_WIN9X
public static final java.lang.String FAMILY_NT
public static final java.lang.String FAMILY_OS2
public static final java.lang.String FAMILY_NETWARE
public static final java.lang.String FAMILY_DOS
public static final java.lang.String FAMILY_MAC
public static final java.lang.String FAMILY_TANDEM
public static final java.lang.String FAMILY_UNIX
public static final java.lang.String FAMILY_OPENVMS
public static final java.lang.String FAMILY_ZOS
public static final java.lang.String FAMILY_OS400
public Os()
public Os(java.lang.String family)
family
- a String valuepublic static java.util.Set<java.lang.String> getValidFamilies()
public static boolean isFamily(java.lang.String family)
family
- the family to check forpublic static boolean isName(java.lang.String name)
name
- the OS name to check forpublic static boolean isArch(java.lang.String arch)
arch
- the OS architecture to check forpublic static boolean isVersion(java.lang.String version)
version
- the OS version to check forpublic static boolean isValidFamily(java.lang.String family)
family
- the os familytrue
if 'family' represents a valid OS-Family, false
otherwise.Copyright © 2013. All Rights Reserved.