public class ResourcePropertySource extends PropertiesPropertySource
PropertiesPropertySource
that loads a Properties
object from a given Resource
or resource location such as
"classpath:/com/myco/foo.properties"
or "file:/path/to/file.properties"
.PropertySource.StubPropertySource
EMPTY_NAMES_ARRAY, logger
name, source
Constructor and Description |
---|
ResourcePropertySource(Resource resource)
Create a PropertySource based on Properties loaded from the given resource.
|
ResourcePropertySource(String location)
Create a PropertySource based on Properties loaded from the given resource
location.
|
ResourcePropertySource(String location,
ClassLoader classLoader)
Create a PropertySource based on Properties loaded from the given resource
location and use the given class loader to load the resource, assuming it is
prefixed with
classpath: . |
ResourcePropertySource(String name,
Resource resource)
Create a PropertySource having the given name based on Properties
loaded from the given resource.
|
ResourcePropertySource(String name,
String location)
Create a PropertySource having the given name based on Properties loaded from
the given resource location.
|
ResourcePropertySource(String name,
String location,
ClassLoader classLoader)
Create a PropertySource having the given name based on Properties loaded from
the given resource location and using the given class loader to load the
resource (assuming it is prefixed with
classpath: ). |
getProperty, getPropertyNames
containsProperty
public ResourcePropertySource(String name, Resource resource) throws IOException
IOException
public ResourcePropertySource(Resource resource) throws IOException
description
of the given resource.IOException
public ResourcePropertySource(String name, String location, ClassLoader classLoader) throws IOException
classpath:
).IOException
public ResourcePropertySource(String name, String location) throws IOException
classpath:
.IOException
public ResourcePropertySource(String location, ClassLoader classLoader) throws IOException
classpath:
. The name of the PropertySource will be
generated based on the description
of the
resource.IOException
public ResourcePropertySource(String location) throws IOException
description
of the resource.IOException