Package com.typesafe.config

Examples of com.typesafe.config.Config.resolve()


  protected static Map<String, String> configuration() {
    Map<String, String> conf = new HashMap<String, String>();
    Config config = ConfigFactory.parseFileAnySyntax(new File(
        "conf/application.conf"));
    config = config.resolve();
    for (Entry<String, ConfigValue> entry : config.entrySet()) {
      ConfigValue value = entry.getValue();
      conf.put(entry.getKey(), value.unwrapped().toString());
    }
    conf.putAll(inMemoryDatabase());
View Full Code Here


public class ConfigTest {
    @Test
    public void configValidationTest() {
        Config conf = ConfigFactory.load("default");
        conf = conf.resolve();
        if (conf.hasPath("greed"))
            System.out.println(conf.getConfig("greed").toString());
    }
}
View Full Code Here

    Config effectiveConfig = ConfigFactory.load(overrideFileName).withFallback(fallback);
    if (overriderProps != null) {
      effectiveConfig = ConfigFactory.parseProperties(overriderProps).withFallback(effectiveConfig);
    }

    return new DrillConfig(effectiveConfig.resolve(), enableServerConfigs);
  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if (className == null) {
View Full Code Here

    Config effectiveConfig = ConfigFactory.load(overrideFileName).withFallback(fallback);
    if (overriderProps != null) {
      effectiveConfig = ConfigFactory.parseProperties(overriderProps).withFallback(effectiveConfig);
    }

    return new DrillConfig(effectiveConfig.resolve(), enableServerConfigs);
  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if(className == null) throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
View Full Code Here

    Config effectiveConfig = ConfigFactory.load(overrideFileName).withFallback(fallback);
    if (overriderProps != null) {
      effectiveConfig = ConfigFactory.parseProperties(overriderProps).withFallback(effectiveConfig);
    }

    return new DrillConfig(effectiveConfig.resolve(), enableServerConfigs);
  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if(className == null) throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.