public class DirectoryConfigProvider extends Object implements ConfigProvider
ConfigProvider based on a directory of files.
Property keys correspond to the names of the regular (i.e. non-directory)
files in a directory given by the path parameter.
Property values are taken from the file contents corresponding to each key.| Constructor and Description |
|---|
DirectoryConfigProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Map<String,?> configs)
Configure this class with the given key-value pairs
|
ConfigData |
get(String path)
Retrieves the data contained in regular files in the directory given by
path. |
ConfigData |
get(String path,
Set<String> keys)
Retrieves the data contained in the regular files named by
keys in the directory given by path. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribe, unsubscribe, unsubscribeAllpublic void configure(Map<String,?> configs)
Configurableconfigure in interface Configurablepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ConfigData get(String path)
path.
Non-regular files (such as directories) in the given directory are silently ignored.get in interface ConfigProviderpath - the directory where data files reside.public ConfigData get(String path, Set<String> keys)
keys in the directory given by path.
Non-regular files (such as directories) in the given directory are silently ignored.get in interface ConfigProviderpath - the directory where data files reside.keys - the keys whose values will be retrieved.