List of usage examples for org.apache.commons.configuration HierarchicalINIConfiguration load
public void load() throws ConfigurationException
From source file:com.tamnd.core.util.ZConfig.java
private static Configuration LoadFromFile(String path) throws ConfigurationException { if (path.endsWith(".ini") || path.endsWith(".properties")) { HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(); config.setDelimiterParsingDisabled(true); config.setFileName(path);/*from w w w.ja v a 2s .co m*/ config.load(); return config; } else if (path.endsWith(".xml")) { return new XMLConfiguration(path); } else { throw new ConfigurationException("Unknown configuration file extension"); } }
From source file:org.midonet.config.ConfigProvider.java
public static HierarchicalConfiguration fromConfigFile(String path) { try {/*from w w w . j a v a 2 s .c o m*/ HierarchicalINIConfiguration config = new HierarchicalINIConfiguration(); config.setDelimiterParsingDisabled(true); config.setFileName(path); config.load(); return config; } catch (ConfigurationException e) { throw new RuntimeException(e); } }