Package io.github.cdimascio.dotenv
Class DotenvxBuilder
- java.lang.Object
-
- io.github.cdimascio.dotenv.DotenvBuilder
-
- io.github.cdimascio.dotenv.DotenvxBuilder
-
public class DotenvxBuilder extends io.github.cdimascio.dotenv.DotenvBuilderBuilds and loads andDotenvinstance with dotenvx support.- See Also:
Dotenvx.configure()
-
-
Constructor Summary
Constructors Constructor Description DotenvxBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DotenvxBuilderdirectory(String path)Sets the directory containing the .env file.DotenvxBuilderfilename(String name)Sets the name of the .env file.DotenvxBuilderignoreIfMalformed()Does not throw an exception when .env is malformed.DotenvxBuilderignoreIfMissing()Does not throw an exception when .env is missing.io.github.cdimascio.dotenv.Dotenvload()Load the contents of .env into the virtual environment.DotenvxBuilderprivateKey(String privateKeyHex)set the private keyDotenvxBuildersystemProperties()Sets each environment variable as system properties.
-
-
-
Method Detail
-
directory
public DotenvxBuilder directory(String path)
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
public DotenvxBuilder filename(String name)
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
public DotenvxBuilder ignoreIfMissing()
Does not throw an exception when .env is missing.- Overrides:
ignoreIfMissingin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- this
DotenvxBuilder
-
ignoreIfMalformed
public DotenvxBuilder ignoreIfMalformed()
Does not throw an exception when .env is malformed.- Overrides:
ignoreIfMalformedin classio.github.cdimascio.dotenv.DotenvBuilder- Returns:
- this
DotenvxBuilder
-
systemProperties
public DotenvxBuilder systemProperties()
Sets each environment variable as system properties.- Overrides:
systemPropertiesin classio.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.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
-
-