public class ConfigResourceLoader extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
RESOURCE_LOADER_PREFIX |
Constructor and Description |
---|
ConfigResourceLoader() |
Modifier and Type | Method and Description |
---|---|
boolean |
isResourceNotAJar(org.springframework.core.io.Resource resource)
A simple predicate that is true if a resource is not from a jar.
|
org.apache.commons.configuration.Configuration |
loadConfigFromResource(org.springframework.core.io.Resource resource)
Build a configuration object from a resource, processing it as a properties file.
|
List<org.apache.commons.configuration.Configuration> |
loadConfigurations(String name)
Use a string pattern to load configurations matching a resource name from the class path and parse into
Configuration objects.
|
List<org.apache.commons.configuration.Configuration> |
loadConfigurationsNoJars(String name)
Use a string path to load configurations matching a resource name from the class path which are not from
jars into Configuration objects.
|
Stream<org.springframework.core.io.Resource> |
loadResourcesWithName(String name)
Use a string to load a stream of all resources from the class path which match a given name.
|
protected static final String RESOURCE_LOADER_PREFIX
public List<org.apache.commons.configuration.Configuration> loadConfigurations(String name) throws IOException
name
- The class path address of a resource ('/foo' means a resource named foo in the default package)IOException
- if any resources cannot be read from the class path successfully.public List<org.apache.commons.configuration.Configuration> loadConfigurationsNoJars(String name) throws IOException
This differentiation generally provides for only the local src directories to supply the resource instances, preventing injection of unwanted resources from class path entries.
name
- The class path address of a resource ('/foo' means a resource named foo in the default package)IOException
- if any resources cannot be read from the class path successfully.public Stream<org.springframework.core.io.Resource> loadResourcesWithName(String name) throws IOException
name
- The class path address of a resource ('/foo' means a resource named foo in the default package)IOException
- if any resources cannot be read from the class path successfully.public org.apache.commons.configuration.Configuration loadConfigFromResource(org.springframework.core.io.Resource resource)
resource
- The resource referring to a properties filepublic boolean isResourceNotAJar(org.springframework.core.io.Resource resource)
resource
- the Resource under testCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.