Example usage for org.apache.commons.configuration BaseConfiguration append

List of usage examples for org.apache.commons.configuration BaseConfiguration append

Introduction

In this page you can find the example usage for org.apache.commons.configuration BaseConfiguration append.

Prototype

public void append(Configuration c) 

Source Link

Document

Appends the content of the specified configuration to this configuration.

Usage

From source file:net.riccardocossu.i18split.maven.I18splitMojo.java

public void execute() throws MojoExecutionException {
    File f = new File(outputBasePath);

    if (!f.exists()) {
        f.mkdirs();//from  ww w. j  av a 2s  .com
    }

    BaseConfiguration conf = new BaseConfiguration();
    conf.addProperty(ConfigKeys.INPUT_DRIVER, inputPlugin);
    conf.addProperty(ConfigKeys.OUTPUT_DRIVER, outputPlugin);
    conf.addProperty(ConfigKeys.OUTPUT_BASE_PATH, outputBasePath);
    conf.addProperty(ConfigKeys.INPUT_BASE_PATH, inputBasePath);
    conf.addProperty(ConfigKeys.INPUT_ENCODING, inputEncoding);
    conf.addProperty(ConfigKeys.OUTPUT_ENCODING, outputEncoding);
    if (pluginsConfig != null) {
        @SuppressWarnings("unchecked")
        MapConfiguration mc = new MapConfiguration(pluginsConfig);
        conf.append(mc);
    }
    org.apache.maven.plugin.logging.Log log = getLog();
    Iterator<String> keys = conf.getKeys();
    while (keys.hasNext()) {
        String k = keys.next();
        log.info(String.format("%s = %s", k, conf.getProperty(k)));
    }
    Engine eng = new Engine(conf);
    eng.process();

}