* and the set of requested property.
* NOTE: An empty 'propfind' request body will be treated as request for all
* property according to the specification.
*/
private void parsePropFindRequest() throws DavException {
propfindProps = new DavPropertyNameSet();
Document requestDocument = getRequestDocument();
// propfind httpRequest with empty body >> retrieve all property
if (requestDocument == null) {
return;
}
// propfind httpRequest with invalid body
Element root = requestDocument.getDocumentElement();
if (!XML_PROPFIND.equals(root.getLocalName())) {
log.info("PropFind-Request has no <propfind> tag.");
throw new DavException(DavServletResponse.SC_BAD_REQUEST, "PropFind-Request has no <propfind> tag.");
}
DavPropertyNameSet include = null;
ElementIterator it = DomUtil.getChildren(root);
int propfindTypeFound = 0;
while (it.hasNext()) {
Element child = it.nextElement();
String nodeName = child.getLocalName();
if (NAMESPACE.getURI().equals(child.getNamespaceURI())) {
if (XML_PROP.equals(nodeName)) {
propfindType = PROPFIND_BY_PROPERTY;
propfindProps = new DavPropertyNameSet(child);
propfindTypeFound += 1;
}
else if (XML_PROPNAME.equals(nodeName)) {
propfindType = PROPFIND_PROPERTY_NAMES;
propfindTypeFound += 1;
}
else if (XML_ALLPROP.equals(nodeName)) {
propfindType = PROPFIND_ALL_PROP;
propfindTypeFound += 1;
}
else if (XML_INCLUDE.equals(nodeName)) {
include = new DavPropertyNameSet();
ElementIterator pit = DomUtil.getChildren(child);
while (pit.hasNext()) {
include.add(DavPropertyName.createFromXml(pit.nextElement()));
}
}
}
}