Package org.owasp.esapi.configuration
Class EsapiPropertyManager
- java.lang.Object
-
- org.owasp.esapi.configuration.EsapiPropertyManager
-
- All Implemented Interfaces:
EsapiPropertyLoader
public class EsapiPropertyManager extends java.lang.Object implements EsapiPropertyLoader
Manager used for loading security configuration properties. Does all the logic to obtain the correct property from correct source. Uses following system properties to find configuration files:- org.owasp.esapi.devteam - lower priority dev file path - org.owasp.esapi.opsteam - higher priority ops file path
- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.TreeSet<AbstractPrioritizedPropertyLoader>loaders
-
Constructor Summary
Constructors Constructor Description EsapiPropertyManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.BooleangetBooleanProp(java.lang.String propertyName)Get any Boolean type property from security configuration.byte[]getByteArrayProp(java.lang.String propertyName)Get any byte array type property from security configuration.intgetIntProp(java.lang.String propertyName)Get any int type property from security configuration.java.lang.StringgetStringProp(java.lang.String propertyName)Get any property from security configuration.
-
-
-
Field Detail
-
loaders
protected java.util.TreeSet<AbstractPrioritizedPropertyLoader> loaders
-
-
Method Detail
-
getIntProp
public int getIntProp(java.lang.String propertyName) throws ConfigurationExceptionGet any int type property from security configuration.- Specified by:
getIntPropin interfaceEsapiPropertyLoader- Returns:
- property value.
- Throws:
ConfigurationException- when property does not exist in configuration or has incorrect type.
-
getByteArrayProp
public byte[] getByteArrayProp(java.lang.String propertyName) throws ConfigurationExceptionGet any byte array type property from security configuration.- Specified by:
getByteArrayPropin interfaceEsapiPropertyLoader- Returns:
- property value.
- Throws:
ConfigurationException- when property does not exist in configuration or has incorrect type.
-
getBooleanProp
public java.lang.Boolean getBooleanProp(java.lang.String propertyName) throws ConfigurationExceptionGet any Boolean type property from security configuration.- Specified by:
getBooleanPropin interfaceEsapiPropertyLoader- Returns:
- property value.
- Throws:
ConfigurationException- when property does not exist in configuration or has incorrect type.
-
getStringProp
public java.lang.String getStringProp(java.lang.String propertyName) throws ConfigurationExceptionGet any property from security configuration. As every property can be returned as string, this method throws exception only when property does not exist.- Specified by:
getStringPropin interfaceEsapiPropertyLoader- Returns:
- property value.
- Throws:
ConfigurationException- when property does not exist in configuration.
-
-