public class PlatformUtils
extends java.lang.Object
PlatformUtils
provides a common location from which a
component can identify the current platform, without the need for
each component to perform its own test of the os.name or os.version
properties.Even though it is not final, this class should not be subclassed.
Modifier and Type | Field and Description |
---|---|
static int |
OS_LINUX
Deprecated.
since 11.0. Do not use this constant directly.
Use
isLinux() |
static int |
OS_MAC
Deprecated.
since 11.0. Do not use this constant directly. Use
isMac() . |
static int |
OS_MAC_PANTHER
Deprecated.
since 11.0. Do not use this constant directly. Use
isMacPanther() . |
static int |
OS_MAC_TIGER
Deprecated.
since 11.0. Do not use this constant directly. Use
isMacTiger() . |
static int |
OS_UNKNOWN
Deprecated.
since 11.0. Do not use this constant directly. Use
isKnown() . |
static int |
OS_WINDOWS
Deprecated.
since 11.0. Do not use this constant directly. Use
isWindows() . |
static int |
OS_WINDOWS_2K
Deprecated.
since 11.0. Do not use this constant directly. Use
isWindows2K() . |
static int |
OS_WINDOWS_NT
Deprecated.
since 11.0. Do not use this constant directly. Use
isWindowsNT() . |
static int |
OS_WINDOWS_XP
Deprecated.
since 11.0. Do not use this constant directly. Use
isWindowsXP() . |
Modifier and Type | Method and Description |
---|---|
static int |
getPlatform()
Deprecated.
since 11.0. Use one of the static methods on this class to
determine the current platform.
|
static boolean |
isAtLeastMacPanther()
Determines whether the current platform is at least Mac OS X Panther.
|
static boolean |
isAtLeastMacTiger()
Determines whether the current platform is at least Mac OS X Tiger.
|
static boolean |
isAtLeastWindows2K()
Determines whether the current platform is at least Windows 2K.
|
static boolean |
isAtLeastWindows7()
Determines whether the current platform is at least Windows 7.
|
static boolean |
isAtLeastWindows8()
Determines whether the current platform is at least Windows 8.
|
static boolean |
isAtLeastWindowsNT()
Called to determine whether the current platform is at least Windows NT.
|
static boolean |
isAtLeastWindowsVista()
Determines whether the current platform is at least Windows Vista.
|
static boolean |
isAtLeastWindowsXP()
Determines whether the current platform is at least Windows XP.
|
static boolean |
isCaseSensitiveFileSystem()
Determine if the local file system of the current platform is case sensitive
|
static boolean |
isKnown()
Determines whether the current platform is a known platform.
|
static boolean |
isLinux()
Determines whether the current platform is Linux.
|
static boolean |
isMac()
Determines whether the current platform is Mac OS X.
|
static boolean |
isMacPanther()
Determines whether the current platform is Mac OS X Panther.
|
static boolean |
isMacTiger()
Determines whether the current platform is Mac OS X Tiger.
|
static boolean |
isWindows()
Determines whether the current platform is Windows.
|
static boolean |
isWindows2K()
Determines whether the current platform is Windows 2K.
|
static boolean |
isWindows7()
Determines whether the current platform is Windows 7.
|
static boolean |
isWindows8()
Determines whether the current platform is Windows 8.
|
static boolean |
isWindowsNT()
Determines whether the current platform is Windows NT.
|
static boolean |
isWindowsVista()
Determines whether the current platform is Windows Vista.
|
static boolean |
isWindowsXP()
Determines whether the current platform is Windows XP.
|
static java.lang.String |
osName()
Returns the same as System.getProperty( "os.name" ).
|
static java.lang.String |
osVersion()
Returns the same as System.getProperty( "os.version" ).
|
public static final int OS_UNKNOWN
isKnown()
.public static final int OS_LINUX
isLinux()
public static final int OS_MAC
isMac()
.public static final int OS_MAC_PANTHER
isMacPanther()
.public static final int OS_MAC_TIGER
isMacTiger()
.public static final int OS_WINDOWS
isWindows()
.public static final int OS_WINDOWS_NT
isWindowsNT()
.public static final int OS_WINDOWS_2K
isWindows2K()
.public static final int OS_WINDOWS_XP
isWindowsXP()
.public static java.lang.String osName()
public static java.lang.String osVersion()
public static int getPlatform()
public static boolean isCaseSensitiveFileSystem()
public static boolean isKnown()
public static boolean isLinux()
public static boolean isMac()
This method will return true regardless of which version of Mac OS X you're using. To determine whether the current platform is a specific version of Mac OS X (Panther, Tiger, etc.), please use one of the specific isMac calls below.
public static boolean isMacPanther()
public static boolean isMacTiger()
public static boolean isWindows()
Note that this method will return true regardless of which version of Windows you're using. To determine whether the current platform is a specific version of Windows (XP, 2K, NT, etc.), please use one of the specific isWindows calls below.
public static boolean isWindowsNT()
public static boolean isWindows2K()
public static boolean isWindowsXP()
public static boolean isWindowsVista()
public static boolean isWindows7()
true
if Windows 7, false
otherwise.public static boolean isWindows8()
true
if Windows 8, false
otherwise.public static boolean isAtLeastMacPanther()
public static boolean isAtLeastMacTiger()
public static boolean isAtLeastWindowsNT()
public static boolean isAtLeastWindows2K()
public static boolean isAtLeastWindowsXP()
public static boolean isAtLeastWindowsVista()
public static boolean isAtLeastWindows7()
true
if at least Windows 7, false
otherwise.public static boolean isAtLeastWindows8()
true
if at least Windows 8, false
otherwise.