@Override public boolean hasResource(Path path) { return getDelegate().hasResource(path); }
public boolean hasResource(Path path) { return getContentStorage(path).hasResource(path); }
/** * Delete all resources and subdirectories of the given resource path * @param tree tree * @param path path * @return true if all resources were deleted successfully. */ public static boolean deletePathRecursive(Tree<ResourceMeta> tree, Path path){ if(tree.hasResource(path)) { //delete just this resource return tree.deleteResource(path); }else if (tree.hasDirectory(path)) { //list resources and delete Set<Resource<ResourceMeta>> resources = tree.listDirectory(path); boolean failed=false; for (Resource<ResourceMeta> resource : resources) { if(resource.isDirectory()){ if(!deletePathRecursive(tree,resource.getPath())){ failed=true; } }else { if(!tree.deleteResource(resource.getPath())){ failed=true; } } } return !failed; }else{ return true; } }