Package io.github.cdimascio.dotenv
Class DotenvxBuilder
java.lang.Object
io.github.cdimascio.dotenv.DotenvBuilder
io.github.cdimascio.dotenv.DotenvxBuilder
- All Implemented Interfaces:
DotenvxBaseBuilder
public class DotenvxBuilder
extends io.github.cdimascio.dotenv.DotenvBuilder
implements DotenvxBaseBuilder
Builds and loads and
Dotenv instance with dotenvx support.- See Also:
-
Field Summary
Fields inherited from interface io.github.cdimascio.dotenv.DotenvxBaseBuilder
objectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the directory containing the .env file.Sets the name of the .env file.getDotenvxPrivateKey(String profileName, String publicKeyHex) getPublicKeyHex(List<io.github.cdimascio.dotenv.DotenvEntry> entries) Does not throw an exception when .env is malformed.Does not throw an exception when .env is missing.io.github.cdimascio.dotenv.Dotenvload()Load the contents of .env into the virtual environment.privateKey(String privateKeyHex) set the private keySets each environment variable as system properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.cdimascio.dotenv.DotenvxBaseBuilder
getPrivateKeyFromGlobalStore
-
Constructor Details
-
DotenvxBuilder
public DotenvxBuilder()
-
-
Method Details
-
directory
Sets the directory containing the .env file.- Overrides:
directoryin classio.github.cdimascio.dotenv.DotenvBuilder- Parameters:
path- the directory containing the .env file- Returns:
- this
DotenvxBuilder
-
filename
Sets the name of the .env file. The default is .env.- Overrides:
filenamein classio.github.cdimascio.dotenv.DotenvBuilder- Parameters:
name- the filename- Returns:
- this
DotenvxBuilder
-
ignoreIfMissing
Does not throw an exception when .env is missing.- Overrides:
ignoreIfMissingin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- this
DotenvxBuilder
-
ignoreIfMalformed
Does not throw an exception when .env is malformed.- Overrides:
ignoreIfMalformedin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- this
DotenvxBuilder
-
systemProperties
Sets each environment variable as system properties.- Overrides:
systemPropertiesin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- this
DotenvxBuilder
-
privateKey
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.DotenvExceptionLoad the contents of .env into the virtual environment.- Overrides:
loadin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- a new
Dotenvinstance - Throws:
io.github.cdimascio.dotenv.DotenvException- when an error occurs
-
getPublicKeyHex
-
getDotenvxPrivateKey
-