Package org.knowm.yank
Class PropertiesUtils
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
public class PropertiesUtils extends Properties
A convenience class used to load Properties files
- Author:
- timmolter
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.Properties
defaults -
Method Summary
Modifier and Type Method Description static PropertiesgetPropertiesFromClasspath(String fileName)Loads a Properties file from the classpath matching the given file namestatic PropertiesgetPropertiesFromPath(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 PropertiesFileNotFoundExceptionLoads 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 PropertiesFileNotFoundExceptionLoads 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
-