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

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

Introduction

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

Prototype

public XMLConfiguration(URL url) throws ConfigurationException 

Source Link

Document

Creates a new instance of XMLConfiguration.

Usage

From source file:org.kitodo.production.plugin.opac.pica.ConfigOpac.java

private static XMLConfiguration getConfig() {
    if (config != null) {
        return config;
    }/*from  ww w.  j ava2 s .  c  om*/
    String configPfad = FilenameUtils.concat(PicaPlugin.getConfigDir(), PicaPlugin.OPAC_CONFIGURATION_FILE);
    if (!new File(configPfad).exists()) {
        String message = "File not found: ".concat(configPfad);
        throw new RuntimeException(message, new FileNotFoundException(message));
    }
    try {
        config = new XMLConfiguration(configPfad);
    } catch (ConfigurationException e) {
        e.printStackTrace();
        config = new XMLConfiguration();
    }
    config.setListDelimiter('&');
    config.setReloadingStrategy(new FileChangedReloadingStrategy());
    return config;
}