public class ConfigUtils extends Object
Constructor and Description |
---|
ConfigUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> |
getConfigBuilder(File file) |
static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> |
getConfigBuilder(String name) |
static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> |
getConfigBuilder(URL url) |
static org.apache.commons.configuration2.PropertiesConfiguration |
loadClasspathConfig(String name) |
static org.apache.commons.configuration2.PropertiesConfiguration |
loadConfig(File file) |
static org.apache.commons.configuration2.PropertiesConfiguration |
loadConfig(String name) |
static org.apache.commons.configuration2.PropertiesConfiguration |
loadConfig(URL url) |
static URL |
locate(String name) |
public static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> getConfigBuilder(File file) throws org.apache.commons.configuration2.ex.ConfigurationException
file
- org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> getConfigBuilder(String name) throws org.apache.commons.configuration2.ex.ConfigurationException
name
- If the file does not exist, attempts to create it in the user's home directory.org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder<org.apache.commons.configuration2.PropertiesConfiguration> getConfigBuilder(URL url) throws org.apache.commons.configuration2.ex.ConfigurationException
url
- org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.PropertiesConfiguration loadClasspathConfig(String name) throws org.apache.commons.configuration2.ex.ConfigurationException
name
- the classpath location, such as "project.properties" in the base package, or
org/foo/project.properties.org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.PropertiesConfiguration loadConfig(File file) throws org.apache.commons.configuration2.ex.ConfigurationException
file
- org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.PropertiesConfiguration loadConfig(String name) throws org.apache.commons.configuration2.ex.ConfigurationException
name
- If the file does not exist, attempts to create it in the user's home directory.org.apache.commons.configuration2.ex.ConfigurationException
public static org.apache.commons.configuration2.PropertiesConfiguration loadConfig(URL url) throws org.apache.commons.configuration2.ex.ConfigurationException
url
- org.apache.commons.configuration2.ex.ConfigurationException
Copyright © 2003–2022 UBC Michael Smith Laboratories. All rights reserved.