Parse and read configurations in java. This package covers only parsing the configuration properties files and resolving the environment variables in these files.
This package didn't upload to the maven central repository. Thus, for using this dependency you can use Jitpack.io.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.serveriev</groupId>
<artifactId>configuration</artifactId>
<version>v1.0</version>
</dependency>
import io.lenur.configuration.Configuration;
public class Application {
public static void main(String[] args) {
Configuration configuration = new Configuration("application.properties");
System.out.println(configuration.get("database.username"));
System.out.println(configuration.get("database.url"));
String[] tech = configuration.getAsStringArray("technology.stack");//returns an array splitted by regex. default delimiter is |
String[] tech1 = configuration.getAsStringArray("technology.stack.regex", ",");//pass own delimiter
}
}
✅ Parsing property files
❌ Parsing yaml files
❌ Parsing xml file
✅ Resolving environment variables
❌ Resolving system variables
Lenur
- Github: @serveriev
Copyright © 2020 Lenur.
This project is MIT licensed.