Class DotenvVar


public class DotenvVar extends DefaultingVar
Dotenv file variable resolver.

The format for this var is "$DE{key[,default]}".

Values are resolved from DotenvPropertySource using either:

  • The default dotenv path resolution when using the no-arg constructor.
  • The path provided via create(Path).
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public static DotenvVar create(Path path)
      Creates a DotenvVar bound to a specific dotenv file path.
      Parameters:
      path - The dotenv file path. Can be null, in which case no properties are loaded.
      Returns:
      A new DotenvVar instance.
    • resolve

      public String resolve(VarResolverSession session, String key)
      Description copied from class: Var
      The interface that needs to be implemented for subclasses of SimpleVar.
      Specified by:
      resolve in class Var
      Parameters:
      session - The session object used for a single instance of a var resolution.
      key - The inside argument of the variable.
      Returns:
      The resolved value.