Search in sources :

Example 1 with ConfigBuilder

use of com.enonic.xp.config.ConfigBuilder in project xp by enonic.

the class ConfigLoader method load.

Map<String, String> load(final File file) throws Exception {
    final Properties props = new Properties();
    try (FileReader reader = new FileReader(file, StandardCharsets.UTF_8)) {
        props.load(reader);
    }
    final ConfigBuilder builder = ConfigBuilder.create();
    builder.addAll(props);
    final Configuration config = this.interpolator.interpolate(builder.build());
    return config.asMap();
}
Also used : Configuration(com.enonic.xp.config.Configuration) ConfigBuilder(com.enonic.xp.config.ConfigBuilder) FileReader(java.io.FileReader) Properties(java.util.Properties)

Aggregations

ConfigBuilder (com.enonic.xp.config.ConfigBuilder)1 Configuration (com.enonic.xp.config.Configuration)1 FileReader (java.io.FileReader)1 Properties (java.util.Properties)1