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.Boolean
getBooleanProp(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.int
getIntProp(java.lang.String propertyName)
Get any int type property from security configuration.java.lang.String
getStringProp(java.lang.String propertyName)
Get any property from security configuration.protected void
loadPropertiesFromFile(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 ConfigurationException
Get 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 ConfigurationException
Get 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 ConfigurationException
Get 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 ConfigurationException
Get 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:
loadPropertiesFromFile
in classAbstractPrioritizedPropertyLoader
- Parameters:
file
-
-
-