public class SubstitutingSourceProvider extends Object implements ConfigurationSourceProvider
ConfigurationSourceProvider
which replaces variables in the underlying configuration
source according to the rules of a custom StringSubstitutor
.Constructor and Description |
---|
SubstitutingSourceProvider(ConfigurationSourceProvider delegate,
org.apache.commons.text.StringSubstitutor substitutor)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
open(String path)
Returns an
InputStream that contains the source of the configuration for the
application. |
public SubstitutingSourceProvider(ConfigurationSourceProvider delegate, org.apache.commons.text.StringSubstitutor substitutor)
delegate
- The underlying ConfigurationSourceProvider
.substitutor
- The custom StringSubstitutor
implementation.public InputStream open(String path) throws IOException
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 © 2011. All rights reserved.