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.| Modifier and Type | Field and Description |
|---|---|
static String | ALLOWED_PATHS_CONFIG |
static String | ALLOWED_PATHS_DOC |
| 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. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribe, unsubscribe, unsubscribeAllpublic static final String ALLOWED_PATHS_CONFIG
public static final String ALLOWED_PATHS_DOC
public void configure(Map<String,?> configs)
Configurableconfigure in interface Configurablepublic void close()
throws IOExceptionclose 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.