@Override public List<Resource<?>> resolveChildren(String path) { ResourcePathResolver resolver = new ResourcePathResolver(getResourceFactory(), this, path); return resolver.resolve(); }
/** * Perform a search, by doing a breadth-first traversal of the resource tree for resources that match the path * string. * * @return A list of resources that match the path string. Empty if there are no matches. */ public List<Resource<?>> search() { return match(path.split(Pattern.quote(File.separator)), 0, res, new LinkedList<Resource<?>>()); }
return singleResult(r); return singleResult(factory.create(DirectoryResource.class, homeDir)); switch (read()) tk = capture(); String regex = pathspecToRegEx(tk.startsWith(slashString) ? tk.substring(1) : tk); Pattern p; try results.addAll(new ResourcePathResolver(factory, child, path, cursor).resolve()); return singleResult(r);
List<Resource<?>> candidates) String regex = pathspecToRegEx(matchLevels[nestStart]); Pattern matchPattern = Pattern.compile(regex); return match(matchLevels, nestStart + 1, res, candidates); match(matchLevels, nestStart, r, candidates);
for (String optionValue : optionValues) String optionPattern = ResourcePathResolver.pathspecToRegEx(optionValue); if (optionValue != null && optionValue.equals(optionPattern))
private Resource<?> getResourceResolved(Resource<?> value) { Resource<?> resource = (Resource<?>) value; File file = (File) resource.getUnderlyingResourceObject(); return new ResourcePathResolver(resourceFactory, resource, file.getPath()).resolve().get(0); }