Class Env

java.lang.Object
com.pnfsoftware.jeb.util.base.Env

public class Env extends Object
Helper to retrieve system environment variables or, as a fallback, local environment variables provided by a Bash interactive shell (on non-Windows systems).
  • Constructor Details

    • Env

      public Env()
  • Method Details

    • get

      public static String get(String name)
      Retrieve an environment variable. First, the system's environment is checked via System.getenv(String). If no variable is found, and the user is running on a non-Windows platform with a Bash, the method attempts to retrieve the variable defined by an interactive terminal session.
      Parameters:
      name - variable name
      Returns:
      the value, null if the variable does not exist
      Throws:
      NullPointerException - if the variable name is null
    • getsafe

      public static String getsafe(String varname)
      Parameters:
      varname -
      Returns:
      the value, empty if null
      Throws:
      NullPointerException - if the variable name is null