public class FileDataSourceFactory extends java.lang.Object implements UpdateProcessorFactory
FileDataSourceBuilder
. Use FileData.dataSource()
to obtain the
new builder.Constructor and Description |
---|
FileDataSourceFactory()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
FileDataSourceFactory |
autoUpdate(boolean autoUpdate)
Deprecated.
Specifies whether the data source should watch for changes to the source file(s) and reload flags
whenever there is a change.
|
UpdateProcessor |
createUpdateProcessor(java.lang.String sdkKey,
LDConfig config,
FeatureStore featureStore)
Deprecated.
Used internally by the LaunchDarkly client.
|
FileDataSourceFactory |
filePaths(java.nio.file.Path... filePaths)
Deprecated.
Adds any number of source files for loading flag data, specifying each file path as a Path.
|
FileDataSourceFactory |
filePaths(java.lang.String... filePaths)
Deprecated.
Adds any number of source files for loading flag data, specifying each file path as a string.
|
public FileDataSourceFactory filePaths(java.lang.String... filePaths) throws java.nio.file.InvalidPathException
Files will be parsed as JSON if their first non-whitespace character is '{'. Otherwise, they will be parsed as YAML.
filePaths
- path(s) to the source file(s); may be absolute or relative to the current working directoryjava.nio.file.InvalidPathException
- if one of the parameters is not a valid file pathpublic FileDataSourceFactory filePaths(java.nio.file.Path... filePaths)
Files will be parsed as JSON if their first non-whitespace character is '{'. Otherwise, they will be parsed as YAML.
filePaths
- path(s) to the source file(s); may be absolute or relative to the current working directorypublic FileDataSourceFactory autoUpdate(boolean autoUpdate)
Note that auto-updating will only work if all of the files you specified have valid directory paths at startup time; if a directory does not exist, creating it later will not result in files being loaded from it.
autoUpdate
- true if flags should be reloaded whenever a source file changespublic UpdateProcessor createUpdateProcessor(java.lang.String sdkKey, LDConfig config, FeatureStore featureStore)
createUpdateProcessor
in interface UpdateProcessorFactory
sdkKey
- the SDK key for your LaunchDarkly environmentconfig
- the LaunchDarkly configurationfeatureStore
- the FeatureStore
to use for storing the latest flag stateUpdateProcessor