Package io.github.cdimascio.dotenv
Class DotenvxPropertiesBuilder
- java.lang.Object
-
- io.github.cdimascio.dotenv.DotenvxPropertiesBuilder
-
public class DotenvxPropertiesBuilder extends Object
Builds and loads properties instance with dotenvx support.
-
-
Field Summary
Fields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description DotenvxPropertiesBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DotenvxPropertiesBuilderdirectory(String path)Sets the directory containing the .properties file.DotenvxPropertiesBuilderfilename(String name)Sets the name of the .properties file.StringgetDotenvxPrivateKey(String profileName, String publicKeyHex)StringgetPublicKeyHex(Properties properties)Propertiesload()Load the contents of .properties into the virtual environment.DotenvxPropertiesBuilderprivateKey(String privateKeyHex)set the private key
-
-
-
Method Detail
-
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
Dotenvinstance - Throws:
io.github.cdimascio.dotenv.DotenvException- when an error occurs
-
getPublicKeyHex
public String getPublicKeyHex(Properties properties)
-
-