org.apache.shiro.web.env
Class IniWebEnvironment
java.lang.Object
org.apache.shiro.env.DefaultEnvironment
org.apache.shiro.web.env.DefaultWebEnvironment
org.apache.shiro.web.env.ResourceBasedWebEnvironment
org.apache.shiro.web.env.IniWebEnvironment
- All Implemented Interfaces:
- ResourceConfigurable, Environment, NamedObjectEnvironment, Destroyable, Initializable, MutableWebEnvironment, WebEnvironment
public class IniWebEnvironment
- extends ResourceBasedWebEnvironment
- implements Initializable, Destroyable
WebEnvironment implementation configured by an Ini instance or Ini resource locations.
- Since:
- 1.2
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_WEB_INI_RESOURCE_PATH
public static final String DEFAULT_WEB_INI_RESOURCE_PATH
- See Also:
- Constant Field Values
IniWebEnvironment
public IniWebEnvironment()
init
public void init()
- Initializes this instance by resolving any potential (explicit or resource-configured)
Ini
configuration and calling configure for actual instance configuration.
- Specified by:
init in interface Initializable
configure
protected void configure()
getSpecifiedIni
protected Ini getSpecifiedIni(String[] configLocations)
throws ConfigurationException
- Throws:
ConfigurationException
getDefaultIni
protected Ini getDefaultIni()
createIni
protected Ini createIni(String configLocation,
boolean required)
throws ConfigurationException
- Creates an
Ini instance reflecting the specified path, or null if the path does not exist and
is not required.
If the path is required and does not exist or is empty, a ConfigurationException will be thrown.
- Parameters:
configLocation - the resource path to load into an Ini instance.required - if the path must exist and be converted to a non-empty Ini instance.
- Returns:
- an
Ini instance reflecting the specified path, or null if the path does not exist and
is not required.
- Throws:
ConfigurationException - if the path is required but results in a null or empty Ini instance.
createFilterChainResolver
protected FilterChainResolver createFilterChainResolver()
createWebSecurityManager
protected WebSecurityManager createWebSecurityManager()
getDefaultConfigLocations
protected String[] getDefaultConfigLocations()
- Returns an array with two elements,
/WEB-INF/shiro.ini and classpath:shiro.ini.
- Returns:
- an array with two elements,
/WEB-INF/shiro.ini and classpath:shiro.ini.
getIni
public Ini getIni()
- Returns the
Ini instance reflecting this WebEnvironment's configuration.
- Returns:
- the
Ini instance reflecting this WebEnvironment's configuration.
setIni
public void setIni(Ini ini)
- Allows for configuration via a direct
Ini instance instead of via
config locations.
If the specified instance is null or empty, the fallback/default resource-based configuration will be used.
- Parameters:
ini - the ini instance to use for creation.
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.