public class EnvironmentUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static DefaultProcessingEnvironment |
PROCESSING_ENVIRONMENT_IMPLEMENTATION |
Modifier | Constructor and Description |
---|---|
private |
EnvironmentUtils()
Disable constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
addVariableToEnvironment(java.util.Map<java.lang.String,java.lang.String> environment,
java.lang.String keyAndValue)
Add a key/value pair to the given environment.
|
static java.util.Map<java.lang.String,java.lang.String> |
getProcEnvironment()
Find the list of environment variables for this process.
|
private static java.lang.String[] |
parseEnvironmentVariable(java.lang.String keyAndValue)
Split a key/value pair into a String[].
|
static java.lang.String[] |
toStrings(java.util.Map<java.lang.String,java.lang.String> environment)
Get the variable list as an array.
|
private static final DefaultProcessingEnvironment PROCESSING_ENVIRONMENT_IMPLEMENTATION
public static java.lang.String[] toStrings(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- the environment to use, may be null
null
if and only if
the input map was null
public static java.util.Map<java.lang.String,java.lang.String> getProcEnvironment() throws java.io.IOException
null
java.io.IOException
- the operation failedpublic static void addVariableToEnvironment(java.util.Map<java.lang.String,java.lang.String> environment, java.lang.String keyAndValue)
environment
- the current environmentkeyAndValue
- the key/value pairprivate static java.lang.String[] parseEnvironmentVariable(java.lang.String keyAndValue)
keyAndValue
- the key/value pair