public class FileConfigProvider extends Object implements ConfigProvider
ConfigProvider
that represents a Properties file.
All property keys and values are stored as cleartext.Modifier and Type | Field and Description |
---|---|
static String |
ALLOWED_PATHS_CONFIG |
static String |
ALLOWED_PATHS_DOC |
Constructor and Description |
---|
FileConfigProvider() |
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 at the given Properties file.
|
ConfigData |
get(String path,
Set<String> keys)
Retrieves the data with the given keys at the given Properties file.
|
protected Reader |
reader(Path path) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
subscribe, unsubscribe, unsubscribeAll
public static final String ALLOWED_PATHS_CONFIG
public static final String ALLOWED_PATHS_DOC
public void configure(Map<String,?> configs)
Configurable
configure
in interface Configurable
public ConfigData get(String path)
get
in interface ConfigProvider
path
- the file where the data residespublic ConfigData get(String path, Set<String> keys)
get
in interface ConfigProvider
path
- the file where the data resideskeys
- the keys whose values will be retrievedprotected Reader reader(Path path) throws IOException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable