Search in sources :

Example 1 with IniFilterChainResolverFactory

use of org.apache.shiro.web.config.IniFilterChainResolverFactory in project shiro by apache.

the class IniWebEnvironment method getDefaults.

protected Map<String, Object> getDefaults() {
    Map<String, Object> defaults = new HashMap<String, Object>();
    defaults.put(FILTER_CHAIN_RESOLVER_NAME, new IniFilterChainResolverFactory());
    return defaults;
}
Also used : HashMap(java.util.HashMap) IniFilterChainResolverFactory(org.apache.shiro.web.config.IniFilterChainResolverFactory)

Example 2 with IniFilterChainResolverFactory

use of org.apache.shiro.web.config.IniFilterChainResolverFactory in project shiro by apache.

the class IniShiroFilter method applyFilterChainResolver.

protected void applyFilterChainResolver(Ini ini, Map<String, ?> defaults) {
    if (ini == null || ini.isEmpty()) {
        // always used).
        return;
    }
    // only create a resolver if the 'filters' or 'urls' sections are defined:
    Ini.Section urls = ini.getSection(IniFilterChainResolverFactory.URLS);
    Ini.Section filters = ini.getSection(IniFilterChainResolverFactory.FILTERS);
    if ((urls != null && !urls.isEmpty()) || (filters != null && !filters.isEmpty())) {
        // either the urls section or the filters section was defined.  Go ahead and create the resolver
        // and set it:
        IniFilterChainResolverFactory filterChainResolverFactory = new IniFilterChainResolverFactory(ini, defaults);
        filterChainResolverFactory.setFilterConfig(getFilterConfig());
        FilterChainResolver resolver = filterChainResolverFactory.getInstance();
        setFilterChainResolver(resolver);
    }
}
Also used : Ini(org.apache.shiro.config.Ini) FilterChainResolver(org.apache.shiro.web.filter.mgt.FilterChainResolver) IniFilterChainResolverFactory(org.apache.shiro.web.config.IniFilterChainResolverFactory)

Example 3 with IniFilterChainResolverFactory

use of org.apache.shiro.web.config.IniFilterChainResolverFactory in project nutzboot by nutzam.

the class NbResourceBasedWebEnvironment method createFilterChainResolver.

public FilterChainResolver createFilterChainResolver() {
    String iniUrls = "[urls]\r\n" + conf.get(ShiroEnvStarter.PROP_INIT_URLS, "").trim();
    log.debug("shiro ini urls  ---> \r\n" + iniUrls);
    Ini ini = new Ini();
    ini.load(iniUrls);
    IniFilterChainResolverFactory resolverFactory = new IniFilterChainResolverFactory(ini, objects);
    return resolverFactory.getInstance();
}
Also used : Ini(org.apache.shiro.config.Ini) IniFilterChainResolverFactory(org.apache.shiro.web.config.IniFilterChainResolverFactory)

Aggregations

IniFilterChainResolverFactory (org.apache.shiro.web.config.IniFilterChainResolverFactory)3 Ini (org.apache.shiro.config.Ini)2 HashMap (java.util.HashMap)1 FilterChainResolver (org.apache.shiro.web.filter.mgt.FilterChainResolver)1