Package com.strobel.core
Class Environment
java.lang.Object
com.strobel.core.Environment
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Recursively expands any environment variable(s) defined within a String.static String
expandVariables
(String s, boolean recursive) Expands any environment variable(s) defined within a String.static int
static String
getVariable
(String variable) Get any variable by name if defined on the systemstatic boolean
is32Bit()
static boolean
is64Bit()
static boolean
isAmd64()
static boolean
static boolean
isLinux()
static boolean
isMac()
static boolean
isMacX64()
static boolean
isOS2()
static boolean
static boolean
isUnix()
static boolean
-
Field Details
-
logger
-
VARIABLE_PATTERN
-
OS_NAME
-
OS_NAME_LOWER
-
OS_ARCH
-
ARCH_DATA_MODEL
-
-
Constructor Details
-
Environment
private Environment()Make sure nobody can instantiate the class
-
-
Method Details
-
isWindows
public static boolean isWindows() -
isOS2
public static boolean isOS2() -
isMac
public static boolean isMac() -
isLinux
public static boolean isLinux() -
isUnix
public static boolean isUnix() -
isFileSystemCaseSensitive
public static boolean isFileSystemCaseSensitive() -
is32Bit
public static boolean is32Bit() -
is64Bit
public static boolean is64Bit() -
isAmd64
public static boolean isAmd64() -
isMacX64
public static boolean isMacX64() -
getVariable
Get any variable by name if defined on the system- Parameters:
variable
- The string with variables to expand. It should be something like '$VARIABLE'- Returns:
- The expanded variable, empty if arg is null or variable is not defined
-
expandVariables
Recursively expands any environment variable(s) defined within a String. If expansion is not possible, the original string will be returned.- Parameters:
s
- a string possibly containing one or more environment variables- Returns:
- The input string with all environment variables expanded
-
expandVariables
Expands any environment variable(s) defined within a String. If expansion is not possible, the original string will be returned.- Parameters:
s
- a string possibly containing one or more environment variablesrecursive
- whether or not variable values should be expanded recursively- Returns:
- The input string with all environment variables expanded
-
getProcessorCount
public static int getProcessorCount() -
isSingleProcessor
public static boolean isSingleProcessor()
-