public static Set<Class<ZuulFilter<?, ?>>> loadFilterTypesFromResources(ClassLoader loader) throws IOException {
        Set<Class<ZuulFilter<?, ?>>> filterTypes = new LinkedHashSet<>();
        for (URL url : Collections.list(loader.getResources(RESOURCE_NAME))) {
            try (InputStream is = url.openStream();
                    InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
                    BufferedReader br = new BufferedReader(isr)) {
                String line;
                while ((line = br.readLine()) != null) {
                    String trimmed = line.trim();
                    if (!trimmed.isEmpty()) {
                        Class<?> clz;
                        try {
                            clz = Class.forName(trimmed, false, loader);
                        } catch (ClassNotFoundException e) {
                            // This can happen if a filter is deleted, but the annotation processor doesn't
                            // remove it from the list.   This is mainly a problem with IntelliJ, which
                            // forces append only annotation processors.  Incremental recompilation drops
                            // most of the classpath, making the processor unable to reconstruct the filter
                            // list.  To work around this problem, use the stale, cached filter list from
                            // the initial full compilation and add to it.  This makes incremental
                            // compilation work later, at the cost of polluting the filter list.  It's a
                            // better experience to log a warning (and do a clean build), than to
                            // mysteriously classes.

                            logger.warn("Missing Filter", e);
                            continue;
                        }
                        @SuppressWarnings("unchecked")
                        Class<ZuulFilter<?, ?>> filterClz = (Class<ZuulFilter<?, ?>>) clz.asSubclass(ZuulFilter.class);
                        filterTypes.add(filterClz);
                    }
                }
            }
        }
        return Collections.unmodifiableSet(filterTypes);
    }
An immutable static collection of filters.
zuul-core/src/main/java/com/netflix/zuul/StaticFilterLoader.java