Example usage for org.apache.commons.configuration Configuration getString

List of usage examples for org.apache.commons.configuration Configuration getString

Introduction

In this page you can find the example usage for org.apache.commons.configuration Configuration getString.

Prototype

String getString(String key);

Source Link

Document

Get a string associated with the given configuration key.

Usage

From source file:com.boozallen.cognition.ingest.storm.bolt.enrich.DecomposeObjectArrayBolt.java

@Override
public void configure(Configuration conf) {
    arrayField = conf.getString(ARRAY_FIELD);
    objectField = conf.getString(OBJECT_FIELD);
    destField = conf.getString(DEST_FIELD);

    Validate.notBlank(arrayField);//from   w  w w  . ja v  a2s .  c o m
    Validate.notBlank(objectField);
    Validate.notBlank(destField);
}

From source file:com.boozallen.cognition.ingest.storm.bolt.enrich.SetDateBolt.java

@Override
public void configure(Configuration conf) {
    dateFormat = conf.getString(DATE_FORMAT);
    dateFields = new ArrayList<>();
    conf.getList(DATE_FIELD).forEach(x -> dateFields.add(x.toString()));

    _updateIndexField = conf.getBoolean(UPDATE_INDEX_FIELD, false);

    Validate.notEmpty(dateFields);/*from   w  w  w.j  a  va  2  s  .c o  m*/
    Validate.notBlank(dateFormat);
}

From source file:com.parallax.server.blocklyprop.security.OAuthServiceImpl.java

@Inject
public void setConfiguration(Configuration configuration) {
    oauthService = new CloudSessionOAuthService(configuration.getString("cloudsession.server"),
            configuration.getString("cloudsession.baseurl"));
}

From source file:com.nesscomputing.config.SystemPropertiesTest.java

@Test
public void testDB2Configuration() {
    Assert.assertThat(cfg.getConfiguration().getBoolean("production", false), is(true));

    Configuration config = cfg.getConfiguration();

    Assert.assertThat(config.getString("t_s_d"), is("t_s"));
    Assert.assertThat(config.getInt("c.m_s"), is(2));

    Assert.assertThat(config.getBoolean("b.a"), is(true));
    Assert.assertThat(config.getBoolean("y.a"), is(false));

    Assert.assertThat(config.getString("s.f-l.u"), is("zzz"));
    Assert.assertThat(config.getBoolean("c.c.a"), is(true));
}

From source file:fr.inria.atlanmod.neoemf.graph.blueprints.tg.config.BlueprintsTgConfig.java

@Override
public void putDefaultConfiguration(Configuration currentConfiguration, File dbLocation)
        throws IllegalArgumentException {
    if (currentConfiguration.getString("blueprints.tg.directory") == null) {
        currentConfiguration.addProperty("blueprints.tg.directory", dbLocation.getAbsolutePath());
    }/*from  ww  w  . ja  va2s.c  o m*/
    if (currentConfiguration.getString("blueprints.tg.file-type") == null) {
        currentConfiguration.addProperty("blueprints.tg.file-type", "GRAPHML");
    }
}

From source file:com.nesscomputing.config.LegacyConfigTest.java

@Test
public void testSuperConfig() {
    Config ts = Config.getConfig("classpath:/test-config/legacy", "test:test_super");
    Configuration c = ts.getConfiguration();
    Assert.assertEquals("yay", c.getString("hi"));
    Assert.assertEquals("frob", c.getString("yay"));
}

From source file:com.intel.mtwilson.fs.ConfigurableFeatureFilesystem.java

public ConfigurableFeatureFilesystem(Configuration config) {
    this.config = config;
    super.setRootPath(config.getString("fs.feature.root"));
}

From source file:edu.berkeley.sparrow.daemon.nodemonitor.ConfigNodeMonitorState.java

@Override
public void initialize(Configuration conf) {
    nodeMonitors = ConfigUtil.parseBackends(conf);
    staticAppId = conf.getString(SparrowConf.STATIC_APP_NAME);
}

From source file:dk.itst.oiosaml.sp.service.session.jdbc.JdbcFactory.java

public void configure(Configuration config) {
    url = config.getString("oiosaml-sp.sessionhandler.jdbc.url");
    username = config.getString("oiosaml-sp.sessionhandler.jdbc.username");
    password = config.getString("oiosaml-sp.sessionhandler.jdbc.password");
    driver = config.getString("oiosaml-sp.sessionhandler.jdbc.driver");

    try {/*from  ww w  .ja v a  2 s  . c o  m*/
        Class.forName(driver);
    } catch (ClassNotFoundException e) {
        throw new RuntimeException("Unable to load driver " + driver, e);
    }
}

From source file:com.evolveum.midpoint.web.security.WebApplicationConfiguration.java

public WebApplicationConfiguration(Configuration config) {
    importFolder = config.getString("importFolder");
    exportFolder = config.getString("exportFolder");
    progressRefreshInterval = config.getInt("progressRefreshInterval", 400);
    abortEnabled = config.getBoolean("abortEnabled", true);

    if (abortEnabled && !isProgressReportingEnabled()) {
        LOGGER.warn(//from w w w  . ja  v  a  2s  .  com
                "Abort functionality requires progress reporting to be enabled - set progressRefreshInterval in '"
                        + MidPointApplication.WEB_APP_CONFIGURATION + "' section to a non-zero value");
        abortEnabled = false;
    }
    String midpointHome = System.getProperty(MIDPOINT_HOME);

    if (importFolder == null) {
        if (StringUtils.isNotEmpty(midpointHome)) {
            importFolder = midpointHome + "/tmp";
        } else {
            importFolder = ".";
        }
    }

    if (exportFolder == null) {
        if (StringUtils.isNotEmpty(midpointHome)) {
            exportFolder = midpointHome + "/tmp";
        } else {
            exportFolder = ".";
        }
    }
}