Class DotenvxBuilder


  • public class DotenvxBuilder
    extends io.github.cdimascio.dotenv.DotenvBuilder
    Builds and loads and Dotenv instance with dotenvx support.
    See Also:
    Dotenvx.configure()
    • Constructor Detail

      • DotenvxBuilder

        public DotenvxBuilder()
    • Method Detail

      • directory

        public DotenvxBuilder directory​(String path)
        Sets the directory containing the .env file.
        Overrides:
        directory in class io.github.cdimascio.dotenv.DotenvBuilder
        Parameters:
        path - the directory containing the .env file
        Returns:
        this DotenvxBuilder
      • filename

        public DotenvxBuilder filename​(String name)
        Sets the name of the .env file. The default is .env.
        Overrides:
        filename in class io.github.cdimascio.dotenv.DotenvBuilder
        Parameters:
        name - the filename
        Returns:
        this DotenvxBuilder
      • ignoreIfMissing

        public DotenvxBuilder ignoreIfMissing()
        Does not throw an exception when .env is missing.
        Overrides:
        ignoreIfMissing in class io.github.cdimascio.dotenv.DotenvBuilder
        Returns:
        this DotenvxBuilder
      • ignoreIfMalformed

        public DotenvxBuilder ignoreIfMalformed()
        Does not throw an exception when .env is malformed.
        Overrides:
        ignoreIfMalformed in class io.github.cdimascio.dotenv.DotenvBuilder
        Returns:
        this DotenvxBuilder
      • systemProperties

        public DotenvxBuilder systemProperties()
        Sets each environment variable as system properties.
        Overrides:
        systemProperties in class io.github.cdimascio.dotenv.DotenvBuilder
        Returns:
        this DotenvxBuilder
      • privateKey

        public DotenvxBuilder privateKey​(String privateKeyHex)
        set the private key
        Parameters:
        privateKeyHex - private key in hexadecimal format
        Returns:
        this DotenvxBuilder
      • load

        public io.github.cdimascio.dotenv.Dotenv load()
                                               throws io.github.cdimascio.dotenv.DotenvException
        Load the contents of .env into the virtual environment.
        Overrides:
        load in class io.github.cdimascio.dotenv.DotenvBuilder
        Returns:
        a new Dotenv instance
        Throws:
        io.github.cdimascio.dotenv.DotenvException - when an error occurs