Class PropertyUtils
java.lang.Object
org.archive.util.PropertyUtils
Utilities for dealing with Java Properties (incl. System Properties)
- Version:
- $Date$ $Revision$
- Author:
- stack, gojomo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBooleanProperty(String key) static intgetIntProperty(String key, int fallback) static StringgetPropertyOrNull(String key) static StringinterpolateWithProperties(String original) Given a string which may contain expressions of the form ${key}, replace each expression with the value corresponding to the given key in System Properties.static StringinterpolateWithProperties(String original, Properties... props) Given a string which may contain expressions of the form ${key}, replace each expression with the value corresponding to the given key in the supplied Properties instance.
-
Field Details
-
propRefPattern
-
-
Constructor Details
-
PropertyUtils
public PropertyUtils()
-
-
Method Details
-
getPropertyOrNull
-
getBooleanProperty
- Parameters:
key- Property key.- Returns:
- Boolean value or false if null or unreadable.
-
getIntProperty
- Parameters:
key- Key to use looking up system property.fallback- If no value found for passedkey, returnfallback.- Returns:
- Value of property or
fallback.
-
interpolateWithProperties
Given a string which may contain expressions of the form ${key}, replace each expression with the value corresponding to the given key in System Properties. If no value is present, the expression is replaced with the empty-string.- Parameters:
original- String- Returns:
- modified String
-
interpolateWithProperties
Given a string which may contain expressions of the form ${key}, replace each expression with the value corresponding to the given key in the supplied Properties instance. If no value is present, the expression is replaced with the empty-string.- Parameters:
original- Stringprops- Properties to try in order; first value found (if any) is used- Returns:
- modified String
-