Package io.dropwizard.configuration
Class SubstitutingSourceProvider
java.lang.Object
io.dropwizard.configuration.SubstitutingSourceProvider
- All Implemented Interfaces:
ConfigurationSourceProvider
A delegating
ConfigurationSourceProvider which replaces variables in the underlying configuration
source according to the rules of a custom StringSubstitutor.-
Constructor Summary
ConstructorsConstructorDescriptionSubstitutingSourceProvider(ConfigurationSourceProvider delegate, org.apache.commons.text.StringSubstitutor substitutor) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns anInputStreamthat contains the source of the configuration for the application.
-
Constructor Details
-
SubstitutingSourceProvider
public SubstitutingSourceProvider(ConfigurationSourceProvider delegate, org.apache.commons.text.StringSubstitutor substitutor) Create a new instance.- Parameters:
delegate- The underlyingConfigurationSourceProvider.substitutor- The customStringSubstitutorimplementation.
-
-
Method Details
-
open
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
-