List of usage examples for org.apache.commons.configuration.io FileHandler setURL
public void setURL(final URL url)
From source file:ubic.basecode.util.ConfigUtils.java
/** * @param name the classpath location, such as "project.properties" in the base package, or * org/foo/project.properties.//from w ww . j ava2s . c o m * @return * @throws ConfigurationException */ public static PropertiesConfiguration loadClasspathConfig(String name) throws ConfigurationException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(name); if (url == null) { throw new ConfigurationException("Couldn't locate: " + name); } PropertiesConfiguration pc = new PropertiesConfiguration(); FileHandler handler = new FileHandler(pc); handler.setURL(url); handler.load(); return pc; }