public class FlexibleConfigurationSourceProvider
extends io.dropwizard.configuration.FileConfigurationSourceProvider
A flexible Dropwizard ConfigurationSourceProvider
. Allows configuration
to be either a string, an external file or a resource in the classpath. Special
tokens are used to determine how to treat the argument.
If the argument is prefixed with the "string prefix" (% by default) the argument is passed as the configuration value.
The argument
can also contain the "resource separator" (| by default) formatted as [file]SEPARATOR[resource].
E.g. "config/app.prefs|config/default/app.prefs". The file portion is optional e.g.
"|config/default/app.prefs". When the argument is processed, the file system is checked for
the file (if specified) and, if found, is used as the configuration file. Otherwise,
the resource is determined from the classpath (via Resources.getResource(String)
)
and used as the configuration file.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_RESOURCE_SEPARATOR |
static String |
DEFAULT_STRING_PREFIX |
Constructor and Description |
---|
FlexibleConfigurationSourceProvider() |
FlexibleConfigurationSourceProvider(String resourceSeparator,
String stringPrefix) |
public static final String DEFAULT_RESOURCE_SEPARATOR
public static final String DEFAULT_STRING_PREFIX
public InputStream open(String value) throws IOException
open
in interface io.dropwizard.configuration.ConfigurationSourceProvider
open
in class io.dropwizard.configuration.FileConfigurationSourceProvider
IOException
Copyright © 2014–2016 Soabase. All rights reserved.