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;
}
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);
}
}
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();
}
Aggregations