Class PropertyFileUtils

java.lang.Object
com.robothy.platform.release.gradle.utils.PropertyFileUtils

public class PropertyFileUtils extends Object
  • Constructor Details

    • PropertyFileUtils

      public PropertyFileUtils()
  • Method Details

    • upsertProperty

      public static String upsertProperty(File propFile, String key, UnaryOperator<String> updater)
      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 null if the key not exist.
    • upsertProperty

      public static String upsertProperty(File propFile, String key, String newValue)
      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; null if the key not found.