Skip to content
No description, website, or topics provided.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.maven.settings.xml
.travis.yml
LICENSE
README.md
pom.xml

README.md

Configuration

The Configuration library is a clean (no external dependencies) Java implementation inspired by and partly based on work found in the Constretto library: https://github.com/constretto/constretto-core

This library contains a simple configuration loading and override mechanism capable of reading properties files from file-system or classpath and also ability to read configuration from environment and java system properties.

Example:

# application.properties
host=localhost
port=28282
accesslog.enabled=true
// Sample Java application using configuration library

public class MyApp {

    public static void main(String[] args) {

        DynamicConfiguration configuration = new StoreBasedDynamicConfiguration.Builder()
                .propertiesResource("application.properties")
                .propertiesResource("application_override.properties")
                .environment("MYAPP_")
                .systemProperties()
                .build();

        String host = configuration.evaluateToString("host");
        int port = configuration.evaluateToInt("port");
        boolean accessLogEnabled = configuration.evaluateToBoolean("accesslog.enabled");

        new MyWebServer(host, port, accessLogEnabled);
    }
}
You can’t perform that action at this time.