public final class Os
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static OsFamily[] |
ALL_FAMILIES |
private static OsFamily[] |
OS_ALL_FAMILIES |
private static java.lang.String |
OS_ARCH |
private static OsFamily |
OS_FAMILY |
static OsFamily |
OS_FAMILY_DOS
All DOS based OSes.
|
static OsFamily |
OS_FAMILY_MAC
All Mac based OSes.
|
static OsFamily |
OS_FAMILY_NETWARE
Netware.
|
static OsFamily |
OS_FAMILY_OS2
OS/2.
|
static OsFamily |
OS_FAMILY_OSX
OSX.
|
static OsFamily |
OS_FAMILY_UNIX
All UNIX based OSes.
|
static OsFamily |
OS_FAMILY_WIN9X
All Windows 9x based OSes.
|
static OsFamily |
OS_FAMILY_WINDOWS
All Windows based OSes.
|
static OsFamily |
OS_FAMILY_WINNT
All Windows NT based OSes.
|
private static java.lang.String |
OS_NAME |
private static java.lang.String |
OS_VERSION |
private static java.lang.String |
PATH_SEP |
Modifier | Constructor and Description |
---|---|
private |
Os()
Private constructor to block instantiation.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
archMatches(java.lang.String arch) |
private static OsFamily[] |
determineAllFamilies() |
private static OsFamily |
determineOsFamily() |
private static boolean |
familyMatches(OsFamily family) |
static OsFamily |
getFamily(java.lang.String name)
Locates an OsFamily by name (case-insensitive).
|
static boolean |
isArch(java.lang.String arch)
Determines if the OS on which Ant is executing matches the given OS
architecture.
|
static boolean |
isFamily(OsFamily family)
Determines if the OS on which Ant is executing matches the given OS
family.
|
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 |
isOs(OsFamily family,
java.lang.String name,
java.lang.String arch,
java.lang.String version)
Determines if the OS on which Ant is executing matches the given OS
family, name, architecture and version.
|
static boolean |
isOs(java.lang.String family,
java.lang.String name,
java.lang.String arch,
java.lang.String version)
Determines if the OS on which Ant is executing matches the given OS
family, name, architecture and version.
|
static boolean |
isVersion(java.lang.String version)
Determines if the OS on which Ant is executing matches the given OS
version.
|
private static boolean |
nameMatches(java.lang.String name) |
private static boolean |
versionMatches(java.lang.String version) |
public static final OsFamily OS_FAMILY_WINDOWS
public static final OsFamily OS_FAMILY_DOS
public static final OsFamily OS_FAMILY_WINNT
public static final OsFamily OS_FAMILY_WIN9X
public static final OsFamily OS_FAMILY_OS2
public static final OsFamily OS_FAMILY_NETWARE
public static final OsFamily OS_FAMILY_UNIX
public static final OsFamily OS_FAMILY_MAC
public static final OsFamily OS_FAMILY_OSX
private static final java.lang.String OS_NAME
private static final java.lang.String OS_ARCH
private static final java.lang.String OS_VERSION
private static final java.lang.String PATH_SEP
private static final OsFamily OS_FAMILY
private static final OsFamily[] OS_ALL_FAMILIES
private static final OsFamily[] ALL_FAMILIES
public static boolean isVersion(java.lang.String version)
version
- The version to check.public static boolean isArch(java.lang.String arch)
arch
- The architecture to check.public static boolean isFamily(java.lang.String family)
family
- The family to check.public static boolean isFamily(OsFamily family)
family
- The family to check.public static boolean isName(java.lang.String name)
name
- Description of Parameterpublic static boolean isOs(java.lang.String family, java.lang.String name, java.lang.String arch, java.lang.String version)
family
- The OS familyname
- The OS namearch
- The OS architectureversion
- The OS versionpublic static boolean isOs(OsFamily family, java.lang.String name, java.lang.String arch, java.lang.String version)
family
- The OS familyname
- The OS namearch
- The OS architectureversion
- The OS versionpublic static OsFamily getFamily(java.lang.String name)
name
- The family name to lookup.private static boolean versionMatches(java.lang.String version)
private static boolean archMatches(java.lang.String arch)
private static boolean nameMatches(java.lang.String name)
private static boolean familyMatches(OsFamily family)
private static OsFamily[] determineAllFamilies()
private static OsFamily determineOsFamily()