Package org.eclipse.jetty.toolchain.test
Class OS
java.lang.Object
org.eclipse.jetty.toolchain.test.OS
Some simple OS specific utilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
True if OS is Linuxstatic final boolean
True if OS is OSXstatic final boolean
True if OS is Unix (Unix || AIX || Linux || OSX)static final boolean
True if OS is windowsstatic final String
Line Separator string.static final String
The name of the OS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
Simple test for OS Namestatic String
separators
(String path) Convert path separators to the System path separators.
-
Field Details
-
OS_NAME
The name of the OS -
IS_WINDOWS
public static final boolean IS_WINDOWSTrue if OS is windows -
IS_OSX
public static final boolean IS_OSXTrue if OS is OSX -
IS_LINUX
public static final boolean IS_LINUXTrue if OS is Linux -
IS_UNIX
public static final boolean IS_UNIXTrue if OS is Unix (Unix || AIX || Linux || OSX) -
LN
Line Separator string.Note: For Java 1.7 or newer, use
System.lineSeparator()
-
-
Constructor Details
-
OS
private OS()
-
-
Method Details
-
separators
Convert path separators to the System path separators.This helps ensure that the paths provided in the unit tests work equally as well on unix / osx / windows.
- Parameters:
path
- the raw path to convert- Returns:
- the converted path
-
isOSName
Simple test for OS Name- Parameters:
name
- the name to look for- Returns:
- true if the name is found in the system OS name.
-