Example usage for org.apache.commons.configuration2.builder.fluent Configurations xmlBuilder

List of usage examples for org.apache.commons.configuration2.builder.fluent Configurations xmlBuilder

Introduction

In this page you can find the example usage for org.apache.commons.configuration2.builder.fluent Configurations xmlBuilder.

Prototype

public FileBasedConfigurationBuilder<XMLConfiguration> xmlBuilder(final String path) 

Source Link

Document

Creates a builder for a XMLConfiguration and initializes it with the given path to the file to be loaded.

Usage

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   ww w .ja va 2s .  c om*/
    FileBasedConfigurationBuilder<XMLConfiguration> builder = configurations.xmlBuilder(file);
    builder.setAutoSave(true);
    return builder.getConfiguration();
}