Reads config from web.xml.
@param filterConfig
@return
423879
private SessionThrottleFilterConfig getConfigFromWebXML(FilterConfig filterConfig){
		int limit = -1;

		String l = filterConfig.getInitParameter("limit");
		try{
			if (l!=null)
				limit = Integer.parseInt(l);
		}catch(NumberFormatException ignored){
			//ignored.
		}

		String target = filterConfig.getInitParameter("redirectTarget");
		if (target==null || target.length()==0)
			limit = -1;

		return new SessionThrottleFilterConfig(limit, target);

	}
486714
@Override
    public Filter createFilter(FilterConfig filterConfig) {
        Binding binding = new Binding();
        SecurityComponents sc = this.createSecurityComponents();
        binding.setVariable("securityComponents", sc);
        binding.setVariable("securityRealm",this);
        BeanBuilder builder = new BeanBuilder();
        builder.parse(filterConfig.getServletContext().getResourceAsStream("/WEB-INF/security/SecurityFilters.groovy"),binding);
        
        WebApplicationContext context = builder.createApplicationContext();
        
        return (Filter) context.getBean("legacy");
    }
501066
public static streamselector[] get_filtered(nitro_service service, String filter) throws Exception{
		streamselector obj = new streamselector();
		options option = new options();
		option.set_filter(filter);
		streamselector[] response = (streamselector[]) obj.getfiltered(service, option);
		return response;
	}
504428
public static system_settings[] get_filtered(nitro_service service, String filter) throws Exception
	{
		system_settings obj = new system_settings();
		options option = new options();
		option.set_filter(filter);
		system_settings[] response = (system_settings[]) obj.getfiltered(service, option);
		return response;
	}
623714
private FileFilter createConfigFilesFilter() {
        SiteConfig config = site.getConfig();
        boolean useDefaultConfigFiles = config.useDefaultConfigFiles();
        if (useDefaultConfigFiles) {
            log.debug("Using default config files.");
            return SiteConfigImpl.DEFAULT_CONFIG_FILES_FILTER;
        } else {//custom config files
            final File[] configFiles = config.getConfigFiles();
            return new FileFilter() {
                @Override
                public boolean accept(File file) {
                    for (File configFile : configFiles) {
                        if (configFile.equals(file)) {
                            return true;
                        }
                    }
                    return false;
                }
            };
        }
    }
317891
public static Collection<String> filterClassesBasedOnBeansXML(BeansXml beansXml, final ResourceLoader resourceLoader, Set<String> classes) {
        if (beansXml != null && beansXml.getBeanDiscoveryMode().equals(BeanDiscoveryMode.NONE)) {
            // if the integrator for some reason ignored the "none" flag make sure we do not process the archive
            return Collections.emptySet();
        }
        Function<Metadata<Filter>, Predicate<String>> filterToPredicateFunction = new Function<Metadata<Filter>, Predicate<String>>() {

            @Override
            public Predicate<String> apply(Metadata<Filter> from) {
                return new FilterPredicate(from, resourceLoader);
            }

        };
        Collection<String> classNames;
        if (beansXml != null && beansXml.getScanning() != null) {
            Collection<Metadata<Filter>> includeFilters;
            if (beansXml.getScanning().getIncludes() != null) {
                includeFilters = beansXml.getScanning().getIncludes();
            } else {
                includeFilters = Collections.emptyList();
            }
            Collection<Metadata<Filter>> excludeFilters;
            if (beansXml.getScanning().getExcludes() != null) {
                excludeFilters = beansXml.getScanning().getExcludes();
            } else {
                excludeFilters = Collections.emptyList();
            }
            /*
             * Take a copy of the transformed collection, this means that the
             * filter predicate is only built once per filter predicate
             */
            Collection<Predicate<String>> includes;
            if (includeFilters.isEmpty()) {
                includes = Collections.emptyList();
            } else {
                includes = new ArrayList<Predicate<String>>(includeFilters.size());
                for (Metadata<Filter> includeFilter : includeFilters) {
                    includes.add(filterToPredicateFunction.apply(includeFilter));
                }
            }
            Collection<Predicate<String>> excludes;
            if (excludeFilters.isEmpty()) {
                excludes = Collections.emptyList();
            } else {
                excludes = new ArrayList<Predicate<String>>(excludeFilters.size());
                for (Metadata<Filter> excludeFilter : excludeFilters) {
                    excludes.add(filterToPredicateFunction.apply(excludeFilter));
                }
            }
            Predicate<String> filters = new ScanningPredicate<String>(includes, excludes);
            classNames = new HashSet<>();
            for (String beanClass : classes) {
                if (filters.test(beanClass)) {
                    classNames.add(beanClass);
                }
            }
        } else {
            classNames = classes;
        }
        return classNames;
    }
453826
public Filter getFilter(ServletConfig servletConfig) throws ServletException {
        synchronized (filterCache) {
            Filter f = filterCache.get(servletConfig);
            if (f == null) {
                DefaultConfigurableFilterConfig filterConfig = new DefaultConfigurableFilterConfig(servletConfig);
                f = factory.createFilter(filterConfig);
                if (maintainLifeCycle) {
                    f.init(filterConfig);
                }
                filterCache.put(servletConfig, f);
            }
            return f;
        }

    }
176700
public static PathFilter getInputPathFilter(JobConf conf) {
    Class<? extends PathFilter> filterClass = conf.getClass(
	"mapred.input.pathFilter.class", null, PathFilter.class);
    return (filterClass != null) ?
        ReflectionUtils.newInstance(filterClass, conf) : null;
  }
768993
public ConfigSettings read()
	{

		ConfigSettings config = new ConfigSettings(ConfigEnum.IMPORT);

		String name;
		Node node;
		NodeList list = root.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			node = list.item(i);

			name = node.getNodeName().toUpperCase();

			if (name.equals(SECTION_MODE)) {
				parseModeConfig(node, config);
			}
			else if (name.equals(SECTION_EXTERNALS)) {
				parseExternalsConfig(node, config);
			}
			else if (name.equals(SECTION_INPUT)) {
				parseInputConfig(node, config);
			}
			else if (name.equals(SECTION_OUTPUT)) {
				parseOutputConfig(node, config);
			}
			else if (name.equals(SECTION_CACHE)) {
				parseCacheConfig(node, config);
			}
			else if (name.equals(SECTION_LOGGING)) {
				parseLoggingConfig(node, config);
			}
			else if (name.equals(SECTION_DEBUG)) {
				parseDebugConfig(node, config);
			}
			else if (name.equals(SECTION_FILTER)) {
				parseFilterConfig(node, config);
			}
		}

		return config;
	}
98480
public List<WebAppFilterMapping> getFilterMappings(final String filterName) {
		final Set<WebAppFilterMapping> webAppFilterMappings = filterMappings
				.get(filterName);
		if (webAppFilterMappings == null) {
			return new ArrayList<>();
		}
		return new ArrayList<>(webAppFilterMappings);
	}
1089516
private Document parseInputSourceWithFilter(InputSource s, XMLFilter f) throws JspException {
        try {
            XMLReader xr = XmlUtil.newXMLReader(entityResolver);
            //   (note that we overwrite the filter's parent.  this seems
            //    to be expected usage.  we could cache and reset the old
            //    parent, but you can't setParent(null), so this wouldn't
            //    be perfect.)
            f.setParent(xr);

            TransformerHandler th = XmlUtil.newTransformerHandler();
            Document o = XmlUtil.newEmptyDocument();
            th.setResult(new DOMResult(o));
            f.setContentHandler(th);

            f.parse(s);
            return o;
        } catch (IOException e) {
            throw new JspException(e);
        } catch (SAXException e) {
            throw new JspException(e);
        } catch (TransformerConfigurationException e) {
            throw new JspException(e);
        } catch (ParserConfigurationException e) {
            throw new JspException(e);
        }
    }
941842
public void init(FilterConfig filterConfig) throws ServletException {
		// need the Context for Logging, instantiating ClassLoader, etc
		context = filterConfig.getServletContext();
		StringBuilder sb = new StringBuilder();
		StringBuilder err = new StringBuilder(); 
		Object attr = context.getAttribute(Config.PATHFILTER_NS);
		if(attr==null) {
			err.append("PathFilter - pathfilter_ns is not set");
		} else {
			sb.append(attr.toString()); 
		}

		attr = context.getAttribute(Config.PATHFILTER_STACK);
		if(attr==null) {
			log.info("PathFilter - No pathfilter_stack set, ignoring");
		} else {
			sb.append('.');
			sb.append(attr.toString());
		}

		attr = context.getAttribute(Config.PATHFILTER_URLPATTERN);
		if(attr==null) {
			log.info("PathFilter - No pathfilter_urlpattern set, defaulting to 'urlpattern'");
			sb.append(".urlpattern");
		} else {
			sb.append('.');
			sb.append(attr.toString());
		}

		log.info("PathFilter - AAF Permission Type is",sb.toString());
		
		sb.append('|');
		
		aaf_type = sb.toString();

		attr = context.getAttribute(Config.PATHFILTER_NOT_AUTHORIZED_MSG);
		if(attr==null) {
			not_authorized_msg = "Forbidden - Not Authorized to access this Path";
		} else {
			not_authorized_msg = attr.toString();
		}

		if(err.length()>0) {
			throw new ServletException(err.toString());
		}
	}
732545
public static configstatus[] get_filtered(nitro_service service, String filter) throws Exception{
		configstatus obj = new configstatus();
		options option = new options();
		option.set_filter(filter);
		configstatus[] response = (configstatus[]) obj.getfiltered(service, option);
		return response;
	}
975236
public static nsxmlnamespace[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		nsxmlnamespace obj = new nsxmlnamespace();
		options option = new options();
		option.set_filter(filter);
		nsxmlnamespace[] response = (nsxmlnamespace[]) obj.getfiltered(service, option);
		return response;
	}
999307
public static policypatset[] get_filtered(nitro_service service, filtervalue[] filter) throws Exception{
		policypatset obj = new policypatset();
		options option = new options();
		option.set_filter(filter);
		policypatset[] response = (policypatset[]) obj.getfiltered(service, option);
		return response;
	}
537781
@Override
    public String getFilterName() {
        FilterConfig sc = getFilterConfig();
        if (sc == null) {
            throw new IllegalStateException(
                lStrings.getString("err.servlet_config_not_initialized"));
        }

        return sc.getFilterName();
    }
205583
public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);

    String dirBrowse = filterConfig.getInitParameter("directoryBrowsingDisallowed");

    if (dirBrowse != null) {
      dirBrowse = dirBrowse.toLowerCase();

      directoryBrowsingDisallowed = dirBrowse.equals("yes") ||
                                    dirBrowse.equals("true");
    }
  }