Class PropertiesUtil
java.lang.Object
com.qaitsolutions.pframe.core.utils.PropertiesUtil
Class handles the reading of properties files in a safe way.
- Since:
- 1.0
- Author:
- Iulian Andrei (iulian.andrei@qaitsolutions.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
Reads a properties files and transforms it into a readable object.static void
write
(@NonNull Properties properties, @NonNull String path, @NonNull String filename) Writes anProperties
object to a properties file.
-
Constructor Details
-
PropertiesUtil
public PropertiesUtil()
-
-
Method Details
-
read
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 anProperties
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.
-