public static class ConfigOperation.Actions extends Object implements ConfigActions
Constructor and Description |
---|
Actions() |
Modifier and Type | Method and Description |
---|---|
Operation<Void> |
create(Path configFile,
Map<String,String> configs)
Creates a handler for persisting property file changes to a new property file.
|
ConfigOperation |
delete(Path propFile)
Creates a handler for deleting a property file.
|
Map<String,String> |
getProperties(Path propFile)
Gets the current key:value pairs set in the given property file.
|
Operation<Void> |
update(Path configFile,
Map<String,String> configs,
boolean keepIfNotPresent)
Creates a handler for persisting property file changes to an existing property file.
|
public Operation<Void> create(Path configFile, Map<String,String> configs) throws ConfiguratorException
PropertyActions
create
in interface PropertyActions
configFile
- the property file to be createdconfigs
- map of key:value pairs to be written to the property fileConfiguratorException
- if an error occurs creating the operatorpublic ConfigOperation delete(Path propFile) throws ConfiguratorException
PropertyActions
delete
in interface PropertyActions
propFile
- the property file to be deletedConfiguratorException
- if an error occurs creating the operatorpublic Operation<Void> update(Path configFile, Map<String,String> configs, boolean keepIfNotPresent) throws ConfiguratorException
PropertyActions
update
in interface PropertyActions
configFile
- the property file to be updatedconfigs
- map of key:value pairs to be written to the property filekeepIfNotPresent
- if true, any keys in the current property file that are not in the
configs
map will be left with their initial values; if false, they will be removed
from the fileConfiguratorException
- if an error occurs creating the operatorpublic Map<String,String> getProperties(Path propFile) throws ConfiguratorException
PropertyActions
getProperties
in interface PropertyActions
propFile
- the property file to queryConfiguratorException
- if there is an error reading the stateThis work is licensed under a Creative Commons Attribution 4.0 International License.