public class EnvironmentUtils extends java.lang.Object
Modifier and Type | Method | 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.
|
static java.lang.String[] |
toStrings(java.util.Map<java.lang.String,java.lang.String> environment) |
Get the variable list as an array.
|
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 pair