Package org.owasp.esapi.configuration
Class StandardEsapiPropertyLoader
- java.lang.Object
-
- org.owasp.esapi.configuration.AbstractPrioritizedPropertyLoader
-
- org.owasp.esapi.configuration.StandardEsapiPropertyLoader
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractPrioritizedPropertyLoader>,EsapiPropertyLoader
public class StandardEsapiPropertyLoader extends AbstractPrioritizedPropertyLoader
Loader capable of loading single security configuration property from standard java properties configuration file.- Since:
- 2.2
-
-
Field Summary
-
Fields inherited from class org.owasp.esapi.configuration.AbstractPrioritizedPropertyLoader
filename, properties
-
-
Constructor Summary
Constructors Constructor Description StandardEsapiPropertyLoader(java.lang.String filename, int priority)
-
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.protected voidloadPropertiesFromFile(java.io.File file)Methods loads configuration from .properties file.-
Methods inherited from class org.owasp.esapi.configuration.AbstractPrioritizedPropertyLoader
compareTo, logSpecial, logSpecial, name, priority
-
-
-
-
Method Detail
-
getIntProp
public int getIntProp(java.lang.String propertyName) throws ConfigurationExceptionGet any int type property from security configuration.- 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.- 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.- 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.- Returns:
- property value.
- Throws:
ConfigurationException- when property does not exist in configuration.
-
loadPropertiesFromFile
protected void loadPropertiesFromFile(java.io.File file)
Methods loads configuration from .properties file.- Specified by:
loadPropertiesFromFilein classAbstractPrioritizedPropertyLoader- Parameters:
file-
-
-