Class EnvList

java.lang.Object
sonia.scm.web.cgi.EnvList

public class EnvList extends Object
  • Constructor Details

    • EnvList

      public EnvList()
    • EnvList

      public EnvList(EnvList list)
  • Method Details

    • set

      public void set(String name, String value)
      Set a name/value pair, null values will be treated as an empty String
      Parameters:
      name - name of environment variable
      value - value of environment variable
    • containsKey

      public boolean containsKey(String key)
      Return true if the list contains an environment variable with the given key.
      Parameters:
      key - name of environment variable
    • asArray

      public String[] asArray()
      Representation suitable for passing to exec.
      Returns:
      array of environment variables
      Since:
      2.12.0
    • asMap

      public Map<String,String> asMap()
      Representation suitable for passing to process builder.
      Returns:
      environment as immutable map
      Since:
      2.12.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getEnvArray

      @Deprecated public String[] getEnvArray()
      Deprecated.
      use asArray() instead
      Get representation suitable for passing to exec.
      Returns:
      array of environment variables
    • asMutableMap

      @Deprecated public Map<String,String> asMutableMap()
      Deprecated.
      the environment should only be modified by set(String, String). Of a Map is required, a immutable Map can be created with asMap().
      Returns environment as mutable map.
      Returns:
      environment as mutable map
      Since:
      1.31