Package org.apache.commons.vfs.util
Class Os
- java.lang.Object
-
- org.apache.commons.vfs.util.Os
-
public final class Os extends java.lang.ObjectClass to help determining the OS.- Author:
- Stefan Bodewig, Magesh Umasankar, Peter Donald
-
-
Field Summary
Fields Modifier and Type Field Description static OsFamilyOS_FAMILY_DOSAll DOS based OSes.static OsFamilyOS_FAMILY_MACAll Mac based OSes.static OsFamilyOS_FAMILY_NETWARENetwarestatic OsFamilyOS_FAMILY_OS2OS/2static OsFamilyOS_FAMILY_OSXOSXstatic OsFamilyOS_FAMILY_UNIXAll UNIX based OSes.static OsFamilyOS_FAMILY_WIN9XAll Windows 9x based OSes.static OsFamilyOS_FAMILY_WINDOWSAll Windows based OSes.static OsFamilyOS_FAMILY_WINNTAll Windows NT based OSes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OsFamilygetFamily(java.lang.String name)Locates an OsFamily by name (case-insensitive).static booleanisArch(java.lang.String arch)Determines if the OS on which Ant is executing matches the given OS architecture.static booleanisFamily(java.lang.String family)Determines if the OS on which Ant is executing matches the given OS family.static booleanisFamily(OsFamily family)Determines if the OS on which Ant is executing matches the given OS family.static booleanisName(java.lang.String name)Determines if the OS on which Ant 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)Determines if the OS on which Ant is executing matches the given OS family, name, architecture and version.static booleanisOs(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 versionstatic booleanisVersion(java.lang.String version)Determines if the OS on which Ant is executing matches the given OS version.
-
-
-
Field Detail
-
OS_FAMILY_WINDOWS
public static final OsFamily OS_FAMILY_WINDOWS
All Windows based OSes.
-
OS_FAMILY_DOS
public static final OsFamily OS_FAMILY_DOS
All DOS based OSes.
-
OS_FAMILY_WINNT
public static final OsFamily OS_FAMILY_WINNT
All Windows NT based OSes.
-
OS_FAMILY_WIN9X
public static final OsFamily OS_FAMILY_WIN9X
All Windows 9x based OSes.
-
OS_FAMILY_OS2
public static final OsFamily OS_FAMILY_OS2
OS/2
-
OS_FAMILY_NETWARE
public static final OsFamily OS_FAMILY_NETWARE
Netware
-
OS_FAMILY_UNIX
public static final OsFamily OS_FAMILY_UNIX
All UNIX based OSes.
-
OS_FAMILY_MAC
public static final OsFamily OS_FAMILY_MAC
All Mac based OSes.
-
OS_FAMILY_OSX
public static final OsFamily OS_FAMILY_OSX
OSX
-
-
Method Detail
-
isVersion
public static boolean isVersion(java.lang.String version)
Determines if the OS on which Ant is executing matches the given OS version.
-
isArch
public static boolean isArch(java.lang.String arch)
Determines if the OS on which Ant is executing matches the given OS architecture.
-
isFamily
public static boolean isFamily(java.lang.String family)
Determines if the OS on which Ant is executing matches the given OS family.
-
isFamily
public static boolean isFamily(OsFamily family)
Determines if the OS on which Ant is executing matches the given OS family.
-
isName
public static boolean isName(java.lang.String name)
Determines if the OS on which Ant is executing matches the given OS name.- Parameters:
name- Description of Parameter- Returns:
- The Name value
- Since:
- 1.7
-
isOs
public 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.- Parameters:
family- The OS familyname- The OS namearch- The OS architectureversion- The OS version- Returns:
- The Os value
-
isOs
public 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- Parameters:
family- The OS familyname- The OS namearch- The OS architectureversion- The OS version- Returns:
- The Os value
-
getFamily
public static OsFamily getFamily(java.lang.String name)
Locates an OsFamily by name (case-insensitive).- Returns:
- the OS family, or null if not found.
-
-