Package org.knowm.yank
Class PropertiesUtils
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
A convenience class used to load Properties files
- Author:
- timmolter
- See Also:
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
getPropertiesFromClasspath
(String fileName) Loads a Properties file from the classpath matching the given file namestatic Properties
getPropertiesFromPath
(String fileName) Loads a Properties file from the given file nameMethods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Method Details
-
getPropertiesFromClasspath
public static Properties getPropertiesFromClasspath(String fileName) throws PropertiesFileNotFoundException Loads a Properties file from the classpath matching the given file name- Parameters:
fileName
-- Returns:
- The Properties file
- Throws:
PropertiesFileNotFoundException
- if the Properties file could not be loaded from the classpath
-
getPropertiesFromPath
public static Properties getPropertiesFromPath(String fileName) throws PropertiesFileNotFoundException Loads a Properties file from the given file name- Parameters:
fileName
-- Returns:
- The Properties file
- Throws:
PropertiesFileNotFoundException
- if the Properties file could not be loaded from the given path and file name
-