Example usage for org.apache.commons.configuration2 XMLConfiguration XMLConfiguration

List of usage examples for org.apache.commons.configuration2 XMLConfiguration XMLConfiguration

Introduction

In this page you can find the example usage for org.apache.commons.configuration2 XMLConfiguration XMLConfiguration.

Prototype

public XMLConfiguration() 

Source Link

Document

Creates a new instance of XMLConfiguration .

Usage

From source file:com.virtlink.commons.configuration2.jackson.BuiltInXmlConfigurationTests.java

@Override
protected XMLConfiguration create(final Map<String, Object> properties) throws ConfigurationException {
    final XMLConfiguration configuration = new XMLConfiguration();
    configuration.initFileLocator(FileLocatorUtils.fileLocator().create());
    return configuration;
}

From source file:com.heliosdecompiler.helios.Helios.java

private static Configuration loadConfiguration() throws IOException, ConfigurationException {
    Configurations configurations = new Configurations();
    File file = Constants.SETTINGS_FILE_XML;
    if (!file.exists()) {
        XMLConfiguration tempConfiguration = new XMLConfiguration();
        new FileHandler(tempConfiguration).save(file);
    }/*from w  w w. ja  v  a  2  s  . com*/
    FileBasedConfigurationBuilder<XMLConfiguration> builder = configurations.xmlBuilder(file);
    builder.setAutoSave(true);
    return builder.getConfiguration();
}