List of usage examples for org.apache.commons.configuration XMLConfiguration load
private void load(InputSource source) throws ConfigurationException
From source file:uk.ac.ebi.fg.biostudies.app.ApplicationPreferences.java
private void load() { // todo: what to do if file is not there? must be a clear error message + shutdown InputStream prefsStream = null; try {/*from ww w . java 2s . c om*/ XMLConfiguration.setDefaultListDelimiter('\uffff'); XMLConfiguration xmlConfig = new XMLConfiguration(); prefsStream = Application.getInstance().getResource("/WEB-INF/classes/" + prefsFileName + ".xml") .openStream(); xmlConfig.load(prefsStream); prefs = xmlConfig; } catch (Exception x) { logger.error("Caught an exception:", x); } finally { if (null != prefsStream) { try { prefsStream.close(); } catch (IOException x) { logger.error("Caught an exception:", x); } } } }