Class DotenvxPropertiesBuilder

java.lang.Object
io.github.cdimascio.dotenv.DotenvxPropertiesBuilder
All Implemented Interfaces:
DotenvxBaseBuilder

public class DotenvxPropertiesBuilder extends Object implements DotenvxBaseBuilder
Builds and loads properties instance with dotenvx support.
  • Field Details

    • objectMapper

      public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • DotenvxPropertiesBuilder

      public DotenvxPropertiesBuilder()
  • Method Details

    • directory

      public DotenvxPropertiesBuilder directory(String path)
      Sets the directory containing the .properties file.
      Parameters:
      path - the directory containing the .properties file
    • filename

      public DotenvxPropertiesBuilder filename(String name)
      Sets the name of the .properties file. The default is application.properties.
      Parameters:
      name - the filename or classpath resource,, such as `classpath:application.properties`
    • privateKey

      public DotenvxPropertiesBuilder privateKey(String privateKeyHex)
      set the private key
      Parameters:
      privateKeyHex - private key in hexadecimal format
    • load

      public Properties load() throws io.github.cdimascio.dotenv.DotenvException
      Load the contents of .properties into the virtual environment.
      Returns:
      a new Dotenv instance
      Throws:
      io.github.cdimascio.dotenv.DotenvException - when an error occurs
    • getPublicKeyHex

      public String getPublicKeyHex(Properties properties)
    • getDotenvxPrivateKey

      public String getDotenvxPrivateKey(String profileName, String publicKeyHex)