Package io.dropwizard.configuration
Class SubstitutingSourceProvider
- java.lang.Object
-
- io.dropwizard.configuration.SubstitutingSourceProvider
-
- All Implemented Interfaces:
ConfigurationSourceProvider
public class SubstitutingSourceProvider extends Object implements ConfigurationSourceProvider
A delegatingConfigurationSourceProviderwhich replaces variables in the underlying configuration source according to the rules of a customStrSubstitutor.
-
-
Constructor Summary
Constructors Constructor Description SubstitutingSourceProvider(ConfigurationSourceProvider delegate, org.apache.commons.text.StrSubstitutor substitutor)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamopen(String path)Returns anInputStreamthat contains the source of the configuration for the application.
-
-
-
Constructor Detail
-
SubstitutingSourceProvider
public SubstitutingSourceProvider(ConfigurationSourceProvider delegate, org.apache.commons.text.StrSubstitutor substitutor)
Create a new instance.- Parameters:
delegate- The underlyingConfigurationSourceProvider.substitutor- The customStrSubstitutorimplementation.
-
-
Method Detail
-
open
public InputStream open(String path) throws IOException
Returns anInputStreamthat contains the source of the configuration for the application. The caller is responsible for closing the result.- Specified by:
openin interfaceConfigurationSourceProvider- Parameters:
path- the path to the configuration- Returns:
- an
InputStream - Throws:
IOException- if there is an error reading the data atpath
-
-