public class PropertySourcesLoader extends Object
MutablePropertySources
using
PropertySourceLoader
s.Constructor and Description |
---|
PropertySourcesLoader()
Create a new
PropertySourceLoader instance backed by a new
MutablePropertySources . |
PropertySourcesLoader(MutablePropertySources propertySources)
Create a new
PropertySourceLoader instance backed by the specified
MutablePropertySources . |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAllFileExtensions()
Returns all file extensions that could be loaded.
|
MutablePropertySources |
getPropertySources()
Return the
MutablePropertySources being loaded. |
PropertySource<?> |
load(Resource resource)
Load the specified resource (if possible) and add it as the first source.
|
PropertySource<?> |
load(Resource resource,
String profile)
Load the profile-specific properties from the specified resource (if any) and add
it as the first source.
|
PropertySource<?> |
load(Resource resource,
String name,
String profile)
Load the profile-specific properties from the specified resource (if any), give the
name provided and add it as the first source.
|
PropertySource<?> |
load(Resource resource,
String group,
String name,
String profile)
Load the profile-specific properties from the specified resource (if any), give the
name provided and add it to a group of property sources identified by the group
name.
|
public PropertySourcesLoader()
PropertySourceLoader
instance backed by a new
MutablePropertySources
.public PropertySourcesLoader(MutablePropertySources propertySources)
PropertySourceLoader
instance backed by the specified
MutablePropertySources
.propertySources
- the destination property sourcespublic PropertySource<?> load(Resource resource) throws IOException
resource
- the source resource (may be null
).null
IOException
- if the source cannot be loadedpublic PropertySource<?> load(Resource resource, String profile) throws IOException
resource
- the source resource (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
- if the source cannot be loadedpublic PropertySource<?> load(Resource resource, String name, String profile) throws IOException
resource
- the source resource (may be null
).name
- the root property name (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
- if the source cannot be loadedpublic PropertySource<?> load(Resource resource, String group, String name, String profile) throws IOException
resource
- the source resource (may be null
).group
- an identifier for the group that this source belongs toname
- the root property name (may be null
).profile
- a specific profile to load or null
to load the default.null
IOException
- if the source cannot be loadedpublic MutablePropertySources getPropertySources()
MutablePropertySources
being loaded.Copyright © 2015 Pivotal Software, Inc.. All rights reserved.