Class ConfigUtils
java.lang.Object
ubic.gemma.core.util.ConfigUtils
Convenience methods for loading configurations.
In-tree port of ubic.basecode.util.ConfigUtils (Renovations Phase 3 baseCode util batch 3).
Only the methods Gemma actually calls were ported. baseCode's full ConfigUtils also exposed
loadConfig(...), getConfigBuilder(...), and locateConfig(...), all of which
depended on FileTools.touch (dropped from Gemma's in-tree FileTools port) and
commons-configuration2 file-locator APIs that Gemma doesn't use. Reintroduce here if needed.
- Author:
- Paul
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.configuration2.PropertiesConfigurationloadClasspathConfig(String name) Load a properties configuration from a classpath resource.
-
Method Details
-
loadClasspathConfig
public static org.apache.commons.configuration2.PropertiesConfiguration loadClasspathConfig(String name) throws org.apache.commons.configuration2.ex.ConfigurationException Load a properties configuration from a classpath resource.- Parameters:
name- the classpath location, such as "project.properties" in the base package, or org/foo/project.properties.- Returns:
- loaded PropertiesConfiguration
- Throws:
org.apache.commons.configuration2.ex.ConfigurationException- if the resource is missing or fails to load
-