ConfigPropertiesUtils¶
-
public final class
ConfigPropertiesUtils¶ A utility class for loading properties.
Methods¶
getDefaultPropertiesFile¶
-
public static File
getDefaultPropertiesFile(ConfigLocation.FileAccessType accessType, Iterable<ConfigLocation> configLocations, String fileName)¶ Returns default config file location.
Parameters: - accessType – the access required for returned File object
- configLocations – the config locations specified by MOTECH in config-locations.properties
- fileName – the file name
getPropertiesFromFile¶
-
public static Properties
getPropertiesFromFile(File file)¶ Loads the properties from given
File.Parameters: - file – the file with properties
Throws: - IOException – if I/O error occurred
Returns: the loaded properties
getPropertiesFromSystemVarString¶
-
public static Properties
getPropertiesFromSystemVarString(String string)¶ Loads the properties from given
String. The format of thisStringshould be “key1=value1;key2=value2;key3=value3;...”.Parameters: - string – the string with properties
Returns: the loaded properties
saveConfig¶
-
public static void
saveConfig(File file, Properties properties)¶ Saves properties to the given
File.Parameters: - file – the file
- properties –