public static class PropertyOperation.Actions extends Object implements PropertyActions
Constructor and Description |
---|
Actions() |
Modifier and Type | Method and Description |
---|---|
PropertyOperation |
create(Path propFile,
Map<String,String> configs)
Creates a handler for persisting property file changes to a new property file.
|
PropertyOperation |
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.
|
PropertyOperation |
update(Path propFile,
Map<String,String> configs,
boolean keepIfNotPresent)
Creates a handler for persisting property file changes to an existing property file.
|
public PropertyOperation create(Path propFile, Map<String,String> configs) throws ConfiguratorException
PropertyActions
create
in interface PropertyActions
propFile
- 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 PropertyOperation delete(Path propFile) throws ConfiguratorException
PropertyActions
delete
in interface PropertyActions
propFile
- the property file to be deletedConfiguratorException
- if an error occurs creating the operatorpublic PropertyOperation update(Path propFile, Map<String,String> configs, boolean keepIfNotPresent) throws ConfiguratorException
PropertyActions
update
in interface PropertyActions
propFile
- 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.