in src/main/java/org/apache/sling/pipes/internal/RemovePipe.java [133:151]
private String removeTree(Resource resource, Resource configuration) throws RepositoryException {
logger.debug("removing tree {}", resource.getPath());
String remainingPath = resource.getPath();
int configuredProperties = removeProperties(resource, configuration);
Node configuredNode = configuration != null ? configuration.adaptTo(Node.class) : null;
NodeIterator childConf = configuredNode != null ? configuredNode.getNodes() : null;
if (childConf == null || (! childConf.hasNext() && configuredProperties == 0)){
remainingPath = removeNode(resource);
} else {
while (childConf.hasNext()) {
Node childToRemove = childConf.nextNode();
Resource child = resource.getChild(childToRemove.getName());
if (child != null){
removeTree(child, configuration.getChild(childToRemove.getName()));
}
}
}
return remainingPath;
}