Class DefaultProcessingEnvironment
java.lang.Object
org.apache.commons.exec.environment.DefaultProcessingEnvironment
- Direct Known Subclasses:
OpenVmsProcessingEnvironment
Helper class to determine the environment variable for the OS. Depending on the JDK the environment variables can be either retrieved directly from the JVM
or requires starting a process to get them running an OS command line.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe environment variables of the process -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a map that obeys the casing rules of the current platform for key lookup.Creates the list of environment variables for this process.protected CommandLine
Deprecated.No longer needed.Gets the list of environment variables for this process.protected BufferedReader
Deprecated.No longer needed.
-
Field Details
-
procEnvironment
The environment variables of the process
-
-
Constructor Details
-
DefaultProcessingEnvironment
public DefaultProcessingEnvironment()Constructs a new instance.
-
-
Method Details
-
createEnvironmentMap
Creates a map that obeys the casing rules of the current platform for key lookup. E.g. on a Windows platform, the map keys will be case-insensitive.- Returns:
- The map for storage of environment variables, never
null
.
-
createProcEnvironment
Creates the list of environment variables for this process.- Returns:
- a amp containing the environment variables.
- Throws:
IOException
- the operation failed.
-
getProcEnvCommand
Deprecated.No longer needed.Determine the OS specific command line to get a list of environment variables.- Returns:
- the command line.
-
getProcEnvironment
Gets the list of environment variables for this process.- Returns:
- a map containing the environment variables.
- Throws:
IOException
- obtaining the environment variables failed.
-
runProcEnvCommand
Deprecated.No longer needed.Runs a process to list the environment variables.- Returns:
- a reader containing the output of the process.
- Throws:
IOException
- starting the process failed.
-