Package org.apache.commons.vfs2.util
Class Os
java.lang.Object
org.apache.commons.vfs2.util.Os
Class to help determining the OS.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OsFamily
All DOS based OSes.static final OsFamily
All Mac based OSes.static final OsFamily
Netware.static final OsFamily
OS/2.static final OsFamily
OSX.static final OsFamily
All UNIX based OSes.static final OsFamily
All Windows 9x based OSes.static final OsFamily
All Windows based OSes.static final OsFamily
All Windows NT based OSes. -
Method Summary
Modifier and TypeMethodDescriptionstatic OsFamily
Locates an OsFamily by name (case-insensitive).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 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 version.static boolean
Determines if the OS on which Ant is executing matches the given OS family, name, architecture and version.static boolean
Determines if the OS on which Ant is executing matches the given OS version.
-
Field Details
-
OS_FAMILY_WINDOWS
All Windows based OSes. -
OS_FAMILY_DOS
All DOS based OSes. -
OS_FAMILY_WINNT
All Windows NT based OSes. -
OS_FAMILY_WIN9X
All Windows 9x based OSes. -
OS_FAMILY_OS2
OS/2. -
OS_FAMILY_NETWARE
Netware. -
OS_FAMILY_UNIX
All UNIX based OSes. -
OS_FAMILY_MAC
All Mac based OSes. -
OS_FAMILY_OSX
OSX.
-
-
Method Details
-
isVersion
Determines if the OS on which Ant is executing matches the given OS version.- Parameters:
version
- The version to check.- Returns:
- true if the version matches.
-
isArch
Determines if the OS on which Ant is executing matches the given OS architecture.- Parameters:
arch
- The architecture to check.- Returns:
- true if the architecture mataches.
-
isFamily
Determines if the OS on which Ant is executing matches the given OS family.- Parameters:
family
- The family to check.- Returns:
- true if the family matches.
-
isFamily
Determines if the OS on which Ant is executing matches the given OS family.- Parameters:
family
- The family to check.- Returns:
- true if the family matches.
-
isName
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
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
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
Locates an OsFamily by name (case-insensitive).- Parameters:
name
- The family name to lookup.- Returns:
- the OS family, or null if not found.
-