Package io.smallrye.config
Class PropertiesConfigSourceProvider
- java.lang.Object
-
- io.smallrye.config.AbstractLocationConfigSourceLoader
-
- io.smallrye.config.PropertiesConfigSourceProvider
-
- All Implemented Interfaces:
org.eclipse.microprofile.config.spi.ConfigSourceProvider
public class PropertiesConfigSourceProvider extends AbstractLocationConfigSourceLoader implements org.eclipse.microprofile.config.spi.ConfigSourceProvider
- Author:
- Jeff Mesnil (c) 2017 Red Hat inc.
-
-
Constructor Summary
Constructors Constructor Description PropertiesConfigSourceProvider(String location, ClassLoader classLoader, boolean includeFileSystem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertiesConfigSourceProvider
classPathResource(String location, ClassLoader classLoader)
static List<org.eclipse.microprofile.config.spi.ConfigSource>
classPathSources(String location, ClassLoader classLoader)
List<org.eclipse.microprofile.config.spi.ConfigSource>
getConfigSources(ClassLoader forClassLoader)
protected String[]
getFileExtensions()
The file extensions to filter the locations to load.protected org.eclipse.microprofile.config.spi.ConfigSource
loadConfigSource(URL url, int ordinal)
Loads aConfigSource
from anURL
.static List<org.eclipse.microprofile.config.spi.ConfigSource>
propertiesSources(String location, ClassLoader classLoader)
static PropertiesConfigSourceProvider
resource(String location, ClassLoader classLoader)
protected List<org.eclipse.microprofile.config.spi.ConfigSource>
tryFileSystem(URI uri, int ordinal)
-
Methods inherited from class io.smallrye.config.AbstractLocationConfigSourceLoader
failOnMissingFile, fallbackToUnknownProtocol, loadConfigSources, loadConfigSources, loadConfigSources, loadConfigSources, tryClassPath, tryHttpResource, tryJar, tryProfiles
-
-
-
-
Constructor Detail
-
PropertiesConfigSourceProvider
public PropertiesConfigSourceProvider(String location, ClassLoader classLoader, boolean includeFileSystem)
-
-
Method Detail
-
getConfigSources
public List<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources(ClassLoader forClassLoader)
- Specified by:
getConfigSources
in interfaceorg.eclipse.microprofile.config.spi.ConfigSourceProvider
-
getFileExtensions
protected String[] getFileExtensions()
Description copied from class:AbstractLocationConfigSourceLoader
The file extensions to filter the locations to load. It does not require to include the dot separator.- Specified by:
getFileExtensions
in classAbstractLocationConfigSourceLoader
- Returns:
- an array with the file extensions.
-
loadConfigSource
protected org.eclipse.microprofile.config.spi.ConfigSource loadConfigSource(URL url, int ordinal) throws IOException
Description copied from class:AbstractLocationConfigSourceLoader
- Specified by:
loadConfigSource
in classAbstractLocationConfigSourceLoader
- Parameters:
url
- theURL
to load theConfigSource
.ordinal
- the ordinal of theConfigSource
.- Returns:
- the loaded
ConfigSource
. - Throws:
IOException
- if an error occurred when reading from theURL
.
-
tryFileSystem
protected List<org.eclipse.microprofile.config.spi.ConfigSource> tryFileSystem(URI uri, int ordinal)
- Overrides:
tryFileSystem
in classAbstractLocationConfigSourceLoader
-
resource
public static PropertiesConfigSourceProvider resource(String location, ClassLoader classLoader)
-
classPathResource
public static PropertiesConfigSourceProvider classPathResource(String location, ClassLoader classLoader)
-
propertiesSources
public static List<org.eclipse.microprofile.config.spi.ConfigSource> propertiesSources(String location, ClassLoader classLoader)
-
classPathSources
public static List<org.eclipse.microprofile.config.spi.ConfigSource> classPathSources(String location, ClassLoader classLoader)
-
-