public class ResourceConfigurationSourceProvider extends Object implements ConfigurationSourceProvider
ConfigurationSourceProvider
which reads the configuration
from a resource file.
In order to abide by the calling conventions of
{ClassLoader#getResourceAsStream} [1], absolute path strings
(i.e. those with leading "/" characters) passed to open(String)
are converted to relative paths by removing the leading "/".
See [1] for more information on resources in Java and how they are loaded at runtime.
[1] https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html
Constructor and Description |
---|
ResourceConfigurationSourceProvider() |
Modifier and Type | Method and Description |
---|---|
InputStream |
open(String path)
Returns an
InputStream that contains the source of the configuration for the
application. |
public InputStream open(String path) throws IOException
ConfigurationSourceProvider
InputStream
that contains the source of the configuration for the
application. The caller is responsible for closing the result.open
in interface ConfigurationSourceProvider
path
- the path to the configurationInputStream
IOException
- if there is an error reading the data at path
Copyright © 2021. All rights reserved.