Package net.ontopia.utils
Class PropertyUtils
java.lang.Object
net.ontopia.utils.PropertyUtils
INTERNAL: Utility class for handling properties and their values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic intINTERNAL: Returns the property value as an int.static StringgetProperty(Map<String, String> properties, String name) INTERNAL: Helper method used to get better error messages with less typing.static StringgetProperty(Map<String, String> properties, String name, boolean required) INTERNAL: Helper method used to get better error messages with less typing.static StringINTERNAL: Helper method used to get better error messages with less typing.static booleanstatic PropertiesloadProperties(File propfile) INTERNAL; Reads properties from a file.static PropertiesloadProperties(InputStream istream) static PropertiesloadPropertiesFromClassPath(String resource) toMap(Properties properties)
-
Constructor Details
-
PropertyUtils
public PropertyUtils()
-
-
Method Details
-
getProperty
INTERNAL: Helper method used to get better error messages with less typing. -
getProperty
INTERNAL: Helper method used to get better error messages with less typing. -
getProperty
INTERNAL: Helper method used to get better error messages with less typing. -
isTrue
-
getInt
INTERNAL: Returns the property value as an int. If the value is not set or any problems occur the default value is returned. -
getInt
- Throws:
NumberFormatException
-
loadProperties
INTERNAL; Reads properties from a file.- Throws:
IOException
-
loadPropertiesFromClassPath
- Throws:
IOException
-
loadProperties
- Throws:
IOException
-
toMap
-
subset
-