/** * Iterate over fileset and common path pattern for them. Example: * * <pre> * { * assets { * fileset { * lib: [js/lib/jquery.js], * home: [css/style.css, js/home.js] * } * } * } * </pre> * * This method returns a set with <code>/css/**</code> and <code>/js/**</code> pattern. * * @return Path pattern of the entire fileset. */ public Set<String> patterns() { return patterns(file -> aggregators.stream() .noneMatch(it -> it.fileset().contains(file))) .map(v -> "/" + v + "/**") .collect(Collectors.toCollection(LinkedHashSet::new)); }
compiler.patterns().forEach(pattern -> routes.get(pattern, handler));
/** * Iterate over fileset and common path pattern for them. Example: * * <pre> * { * assets { * fileset { * lib: [js/lib/jquery.js], * home: [css/style.css, js/home.js] * } * } * } * </pre> * * This method returns a set with <code>/css/**</code> and <code>/js/**</code> pattern. * * @return Path pattern of the entire fileset. */ public Set<String> patterns() { return patterns(file -> aggregators.stream() .noneMatch(it -> it.fileset().contains(file))) .map(v -> "/" + v + "/**") .collect(Collectors.toCollection(LinkedHashSet::new)); }
compiler.patterns().forEach(pattern -> routes.get(pattern, handler));