Package org.apache.commons.exec.environment

# Class DefaultProcessingEnvironment

java.lang.Object
org.apache.commons.exec.environment.DefaultProcessingEnvironment

Direct Known Subclasses:
  `OpenVmsProcessingEnvironment`

public class DefaultProcessingEnvironment extends Object
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

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<String,String>`
  `procEnvironment`
  The environment variables of the process

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultProcessingEnvironment()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Map<String,String>`
  `createProcEnvironment()`
  Creates the list of environment variables for this process.
  `protected CommandLine`
  `getProcEnvCommand()`
  Deprecated.
  No longer needed.
  `Map<String,String>`
  `getProcEnvironment()`
  Gets the list of environment variables for this process.
  `protected BufferedReader`
  `runProcEnvCommand()`
  Deprecated.
  No longer needed.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### procEnvironment

    protected Map<String,String> procEnvironment
    The environment variables of the process

- ## Constructor Details

  - ### DefaultProcessingEnvironment

    public DefaultProcessingEnvironment()
    Constructs a new instance.

- ## Method Details

  - ### createProcEnvironment

    protected Map<String,String> createProcEnvironment() throws IOException
    Creates the list of environment variables for this process.
    Returns:
      a map containing the environment variables.
    Throws:
      `IOException` - the operation failed.

  - ### getProcEnvCommand

    @Deprecated protected CommandLine getProcEnvCommand()
    Deprecated.
    No longer needed.
    Determine the OS specific command line to get a list of environment variables.
    Returns:
      the command line.

  - ### getProcEnvironment

    public Map<String,String> getProcEnvironment() throws IOException
    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 protected BufferedReader runProcEnvCommand() throws IOException
    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.