* @param ms
*/
private void buildResponse(DavResource res, DavPropertyNameSet propNameSet,
int depth, MultiStatus ms) {
// loop over members first, since this report only list members
DavResourceIterator it = res.getMembers();
while (!vhHrefSet.isEmpty() && it.hasNext()) {
DavResource childRes = it.nextResource();
if (childRes instanceof VersionControlledResource) {
try {
VersionHistoryResource vhr = ((VersionControlledResource)childRes).getVersionHistory();
if (vhHrefSet.remove(vhr.getHref())) {
if (propNameSet.isEmpty()) {
ms.addResourceStatus(childRes, DavServletResponse.SC_OK, 0);
} else {
ms.addResourceProperties(childRes, propNameSet, 0);
}
}
} catch (DavException e) {
log.info(e.getMessage());
}
}
// traverse subtree
if (depth > 0) {
buildResponse(it.nextResource(), propNameSet, depth-1, ms);
}
}
}