Class PropertyFileUtils
java.lang.Object
com.robothy.platform.release.gradle.utils.PropertyFileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringupsertProperty(File propFile, String key, String newValue) Upsert a value to a property file.static StringupsertProperty(File propFile, String key, UnaryOperator<String> updater) Upsert en entry to a properties file.
-
Constructor Details
-
PropertyFileUtils
public PropertyFileUtils()
-
-
Method Details
-
upsertProperty
Upsert en entry to a properties file.- Parameters:
propFile- the properties file.key- the key.updater- consumes the old value and returns a new value.- Returns:
- the old value; or
nullif the key not exist.
-
upsertProperty
Upsert a value to a property file.- Parameters:
propFile- the property file.key- the property key.newValue- new value associate with the key.- Returns:
- the old value of the property;
nullif the key not found.
-