Package jmri.util
Class SystemType
- java.lang.Object
-
- jmri.util.SystemType
-
public class SystemType extends java.lang.Object
Common utility methods for determining which type of operating system is in use.
-
-
Constructor Summary
Constructors Constructor Description SystemType()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getOSName()
The os.name propertystatic int
getType()
Get the integer constant for the OS.static boolean
isLinux()
Convenience method to determine if OS is Linux.static boolean
isMacOSX()
Convenience method to determine if OS is Mac OS X.static boolean
isOS2()
Convenience method to determine if OS is OS/2.static boolean
isUnix()
Convenience method to determine if OS is Unix.static boolean
isWindows()
Convenience method to determine if OS is Microsoft Windows.(package private) static void
setType()
-
-
-
Field Detail
-
MACCLASSIC
public static final int MACCLASSIC
- See Also:
- Constant Field Values
-
MACOSX
public static final int MACOSX
- See Also:
- Constant Field Values
-
WINDOWS
public static final int WINDOWS
- See Also:
- Constant Field Values
-
LINUX
public static final int LINUX
- See Also:
- Constant Field Values
-
OS2
public static final int OS2
- See Also:
- Constant Field Values
-
UNIX
public static final int UNIX
- See Also:
- Constant Field Values
-
type
static int type
-
isSet
static boolean isSet
-
osName
static java.lang.String osName
-
-
Constructor Detail
-
SystemType
public SystemType()
-
-
Method Detail
-
getType
public static int getType()
Get the integer constant for the OS. Useful in switch statements.- Returns:
- Type as an integer
-
getOSName
public static java.lang.String getOSName()
The os.name property- Returns:
- OS name
-
isMacOSX
public static boolean isMacOSX()
Convenience method to determine if OS is Mac OS X. Useful if an exception needs to be made for Mac OS X.- Returns:
- true if on Mac OS X.
-
isLinux
public static boolean isLinux()
Convenience method to determine if OS is Linux. Useful if an exception needs to be made for Linux.- Returns:
- true if on Linux
-
isWindows
public static boolean isWindows()
Convenience method to determine if OS is Microsoft Windows. Useful if an exception needs to be made for Microsoft Windows.- Returns:
- true if on Microsoft Windows
-
isOS2
public static boolean isOS2()
Convenience method to determine if OS is OS/2. Useful if an exception needs to be made for OS/2.- Returns:
- true if on OS/2
-
isUnix
public static boolean isUnix()
Convenience method to determine if OS is Unix. Useful if an exception needs to be made for Unix.- Returns:
- true if on Unix
-
setType
static void setType()
-
-