| java.lang.Object com.metaboss.util.PropertiesUtils
PropertiesUtils | public class PropertiesUtils (Code) | | Useful collection utilities class
|
filterProperties | public static Properties filterProperties(Properties pSource, String pPrefix, boolean pCutPrefix)(Code) | | Returns bag of properties, which is a subset of the given properties filtered down
to only contain properties with required prefix
Parameters: pSource - the source property bag Parameters: pPrefix - the prefix to look for Parameters: pCutPrefix - if equals true - the prefix itself will be cut from the property names in the returned proiperty bag |
getMandatoryProperty | public static String getMandatoryProperty(String pPropertyName, Properties pPropertiesSource) throws IllegalArgumentException(Code) | | Returns the value of the specified property if it is present in the specified bag or throws Exception
Parameters: pPropertyName - the name of the property lo look for Parameters: pPropertiesSource - the properties bag to look in for the property in exception: IllegalArgumentException - thrown if value for the property is not present in the supplied property bag |
getMandatorySystemProperty | public static String getMandatorySystemProperty(String pPropertyName) throws IllegalArgumentException(Code) | | Returns the value of the specified property if it is present in the system properties or throws Exception
Parameters: pPropertyName - the name of the property lo look for Parameters: pPropertiesSource - the properties bag to look in for the property in exception: IllegalArgumentException - thrown if value for the property is not present in the supplied property bag |
resolveProperties | public static Properties resolveProperties(Properties pSource, Properties pKnownProperties)(Code) | | This method allows to use Ant - style variables in the properties. It returns bag of properties, which has all source properties
with resolved macros. When looking for the value of the macro - this method looks at the source bag first and at the
supplied known properties bag second.
Parameters: pSource - the source property bag where whole or part value can be expressed as Ant style expression referring to otherproperty. Parameters: pKnownProperties - the bag of already known properties bag of properties with resolved values |
|
|