use of com.typesafe.config.ConfigParseOptions in project oap by oaplatform.
the class HoconFactoryWithFallback method _createParser.
@Override
protected HoconTreeTraversingParser _createParser(Reader r, IOContext ctxt) throws IOException {
ConfigParseOptions options = ConfigParseOptions.defaults();
Config config = ConfigFactory.parseReader(r, options);
final Config unresolvedConfig = additinal.withFallback(config).withFallback(ConfigFactory.systemProperties());
try {
Config resolvedConfig = unresolvedConfig.resolve();
return new HoconTreeTraversingParser(resolvedConfig.root(), _objectCodec);
} catch (ConfigException e) {
log.error(unresolvedConfig.root().render());
throw e;
}
}
use of com.typesafe.config.ConfigParseOptions in project oap by oaplatform.
the class HoconFactoryWithSystemProperties method _createParser.
@Override
protected HoconTreeTraversingParser _createParser(Reader r, IOContext ctxt) throws IOException {
final ConfigParseOptions options = ConfigParseOptions.defaults();
final Config config = ConfigFactory.parseReader(r, options);
final Config unresolvedConfig = config.withFallback(ConfigFactory.systemProperties());
// log.trace( unresolvedConfig.root().render() );
try {
final Config resolvedConfig = unresolvedConfig.resolve();
return new HoconTreeTraversingParser(resolvedConfig.root(), _objectCodec);
} catch (ConfigException e) {
log.error(unresolvedConfig.root().render());
throw e;
}
}
use of com.typesafe.config.ConfigParseOptions in project helios by spotify.
the class HeliosConfig method loadConfig.
/**
* Return the root configuration loaded from the helios configuration files.
*/
static Config loadConfig() {
final ConfigResolveOptions resolveOptions = ConfigResolveOptions.defaults().setAllowUnresolved(true);
final ConfigParseOptions parseOptions = ConfigParseOptions.defaults();
final Config baseConfig = ConfigFactory.load(BASE_CONFIG_FILE, parseOptions, resolveOptions);
final Config appConfig = ConfigFactory.load(APP_CONFIG_FILE, parseOptions, resolveOptions);
return appConfig.withFallback(baseConfig);
}
Aggregations