- All Implemented Interfaces:
- Enclosing class:
public static final class FileConfigSource.Builder extends AbstractConfigSourceBuilder<FileConfigSource.Builder,
implements PollableSource.Builder<FileConfigSource.Builder>, WatchableSource.Builder<FileConfigSource.Builder, Path>, ParsableSource.Builder<FileConfigSource.Builder>, Builder<FileConfigSource.Builder, FileConfigSource>
File ConfigSource Builder.
It allows to configure following properties:
path- configuration file path;
optional- is existence of configuration resource optional, or mandatory (by default)?
media-type- configuration content media type to be used to look for appropriate
parser- or directly set
ConfigParserinstance to be used to parse the source;
media-type not set it tries to guess it from file extension.
Method SummaryModifier and TypeMethodDescription
build()Builds new instance of File ConfigSource.Configure a change watcher.Configure builder from meta configuration.Configure the path to read configuration from (mandatory).Configure a polling strategy.
Methods inherited from class io.helidon.config.AbstractConfigSourceBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pathConfigure the path to read configuration from (mandatory).
path- path of a file to use
- updated builder instance
configConfigure builder from meta configuration.
The following configuration options are supported:
Optional configuration parameters key default value description optional
trueif this source should not fail configuration setup when underlying data is missing.
polling-strategy No polling strategy is added by default Meta configuration of a polling strategy to be used with this source, add configuration to
change-watcher No change watcher is added by default Meta configuration of a change watcher to be used with this source, add configuration to
retry-policy No retry policy is added by default Meta configuration of a retry policy to be used to load this source, add configuration to
Media type and type mapping media-type Media type from loaded data is used by default for parsable config sources Explicit media type to use, such as when a file has invalid suffix, or when we need to explicitly mark the media type. media-type-mapping No media type mapping is done by default A mapping of key to a media type, allowing us to have a key that contains a sub-tree (e.g. a key that contains json data) - when we configure a mapping of the key to
application/json, the data would be expanded into config as a proper tree structure
path- path to the file containing the configuration
parserDescription copied from class:
mediaTypeDescription copied from class:
changeWatcherDescription copied from class:
AbstractSourceBuilderConfigure a change watcher. This method must be exposed by builders of sources that change watching (
WatchableSource). The type of the change watcher must match the type of the target of this source.
pollingStrategyDescription copied from class:
AbstractSourceBuilderConfigure a polling strategy. This method must be exposed by builders of sources that support polling. If you see this method as being protected in your builder, the source has removed support for polling, such as
buildpublic FileConfigSource build()Builds new instance of File ConfigSource.
media-typenot set it tries to guess it from file extension.