Class PropertiesUtil

java.lang.Object
com.qaitsolutions.pframe.core.utils.PropertiesUtil

public final class PropertiesUtil extends Object
Class handles the reading of properties files in a safe way.

Since:
1.0
Author:
Iulian Andrei (iulian.andrei@qaitsolutions.com)
  • Constructor Details

    • PropertiesUtil

      public PropertiesUtil()
  • Method Details

    • read

      public static Properties read(@NonNull @NonNull String path)
      Reads a properties files and transforms it into a readable object.

      Parameters:
      path - path and filename of the properties file to be read.
      Returns:
      Properties object with values from file. If file was not found an empty object is returned.
    • write

      public static void write(@NonNull @NonNull Properties properties, @NonNull @NonNull String path, @NonNull @NonNull String filename)
      Writes an Properties object to a properties file.

      Parameters:
      properties - Values that need to be written to file.
      path - Directory where to write the file.
      filename - Filename of the new properties file.