Class EnvironmentUtils
java.lang.Object
org.apache.commons.exec.environment.EnvironmentUtils
Wraps environment variables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DefaultProcessingEnvironmentDefault environment. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddVariableToEnvironment(Map<String, String> environment, String keyAndValue) Adds a key/value pair to the given environment.Gets the list of environment variables for this process.private static String[]parseEnvironmentVariable(String keyAndValue) Parses a key/value pair into a String[].private static Stringstatic String[]Converts a variable map as an array.
-
Field Details
-
ENVIRONMENT
Default environment.
-
-
Constructor Details
-
EnvironmentUtils
private EnvironmentUtils()Hides constructor.
-
-
Method Details
-
addVariableToEnvironment
-
getProcEnvironment
Gets the list of environment variables for this process. The returned map preserves the casing of a variable's name on all platforms but obeys the casing rules of the current platform during lookup, e.g. key names will be case-insensitive on Windows platforms.- Returns:
- a map containing the environment variables, may be empty but never
null. - Throws:
IOException- the operation failed.
-
parseEnvironmentVariable
-
toString
-
toStrings
-