protected boolean matchPatterns(String path){ for(int i=0;i<patterns.length;i++){ if(patternMatcher.match(patterns[i], path)){ return true; } } return false; }
if (getPathMatcher().match(fullPattern, currPath)) { result.add(content);
@Override public boolean matches(RequestBase request) { String path = request.getPath(ignoreCase); return isPattern ? matcher.match(pattern, path) : pattern.equals(path); } }
public void visit(Object vfsResource) { String relativePath = VfsUtils.getPath(vfsResource).substring(this.rootPath.length()); if (this.pathMatcher.match(this.subPattern,relativePath)) { this.resources.add(new VfsResource(vfsResource)); } }
@Override @SuppressWarnings("unchecked") public ServletResource[] scan(String subPattern) { Args.notEmpty(subPattern,"subPattern"); Set<String> subPaths = this.servletContext.getResourcePaths(this.path); List<SimpleServletResource> resources = new ArrayList<>(); PathMatcher matcher = Resources.getPathMatcher(); for(String subPath : subPaths){ if(matcher.match(subPattern, subPath)){ resources.add(new SimpleServletResource(servletContext, subPath)); } } return resources.toArray(new SimpleServletResource[resources.size()]); }
@Override public Resource[] searchClasspaths(String... classpathPatterns) { Args.notNull(classpathPatterns,"classpath patterns"); Set<Resource> resources = new LinkedHashSet<Resource>(); for(String classpathPattern : classpathPatterns){ if(classpathPattern.startsWith("/")){ classpathPattern = classpathPattern.substring(1); } for(int i=0;i<values.length;i++){ Resource resource = values[i]; if(null != resource.getClasspath()){ if(Resources.matcher.match(classpathPattern,resource.getClasspath())){ resources.add(resource); } } } } return resources.toArray(new Resource[resources.size()]); }
@Override public Resource[] searchUrls(String... locationPatterns) { Args.notNull(locationPatterns,"location patterns"); Set<Resource> resources = new LinkedHashSet<Resource>(); for(String locationPattern : locationPatterns){ try { for(int i=0;i<values.length;i++){ Resource resource = values[i]; if(Resources.matcher.match(locationPattern,resource.getURL().toExternalForm())){ resources.add(resource); } } } catch (IOException e) { throw new NestedIOException(e); } } return resources.toArray(new Resource[resources.size()]); }
public AppResource[] searchResources(String[] patterns){ Set<AppResource> set = new TreeSet<>(new ResourceComparator()); final PathMatcher matcher = Resources.getPathMatcher(); for(String namedPattern : patterns){ if(namedPattern.startsWith("/")){ namedPattern = namedPattern.substring(1); } for(AppResource r : sortedResources) { if(null != r.getPath()) { String path = r.getPath(); if(matcher.match(namedPattern, path)) { set.add(r); } } } } return set.toArray(new AppResource[0]); }
if (entryPath.startsWith(rootEntryPath)) { String relativePath = entryPath.substring(rootEntryPath.length()); if (getPathMatcher().match(subPattern, relativePath)) { result.add(rootDirResource.createRelative(relativePath));