Package org.springframework.boot.env
Class PropertiesPropertySourceLoader
- java.lang.Object
- org.springframework.boot.env.PropertiesPropertySourceLoader
- All Implemented Interfaces:
PropertySourceLoader
public class PropertiesPropertySourceLoader extends Object implements PropertySourceLoader
Strategy to load '.properties' files into aPropertySource
.
Constructor Summary
Constructors Constructor Description PropertiesPropertySourceLoader()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
getFileExtensions()
Returns the file extensions that the loader supports (excluding the '.').org.springframework.core.env.PropertySource<?>
load(String name, org.springframework.core.io.Resource resource, String profile)
Load the resource into a property source.
Constructor Detail
PropertiesPropertySourceLoader
public PropertiesPropertySourceLoader()
Method Detail
getFileExtensions
public String[] getFileExtensions()
Description copied from interface:PropertySourceLoader
Returns the file extensions that the loader supports (excluding the '.').- Specified by:
getFileExtensions
in interfacePropertySourceLoader
- Returns:
- the file extensions
load
public org.springframework.core.env.PropertySource<?> load(String name, org.springframework.core.io.Resource resource, String profile) throws IOException
Description copied from interface:PropertySourceLoader
Load the resource into a property source.- Specified by:
load
in interfacePropertySourceLoader
- Parameters:
name
- the name of the property sourceresource
- the resource to loadprofile
- the name of the profile to load ornull
. The profile can be used to load multi-document files (such as YAML). Simple property formats shouldnull
when asked to load a profile.- Returns:
- a property source or
null
- Throws:
IOException
- if the source cannot be loaded