Class Environment
java.lang.Object
com.strobel.core.Environment
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringRecursively expands any environment variable(s) defined within a String.static StringexpandVariables(String s, boolean recursive) Expands any environment variable(s) defined within a String.static intstatic StringgetVariable(String variable) Get any variable by name if defined on the systemstatic booleanis32Bit()static booleanis64Bit()static booleanisAmd64()static booleanstatic booleanisLinux()static booleanisMac()static booleanisMacX64()static booleanisOS2()static booleanstatic booleanisUnix()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
-
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()
-