* that a non-existing request body is a valid request used to refresh
* an existing lock.
* @see DavServletRequest#getLockInfo()
*/
public LockInfo getLockInfo() throws DavException {
LockInfo lockInfo;
boolean isDeep = (getDepth(DEPTH_INFINITY) == DEPTH_INFINITY);
Document requestDocument = getRequestDocument();
// check if XML request body is present. It SHOULD have one for
// 'create Lock' request and missing for a 'refresh Lock' request
if (requestDocument != null) {
Element root = requestDocument.getDocumentElement();
if (root.getLocalName().equals(XML_LOCKINFO)) {
lockInfo = new LockInfo(root, getTimeout(), isDeep);
} else {
log.debug("Lock request body must start with a DAV:lockinfo element.");
throw new DavException(DavServletResponse.SC_BAD_REQUEST);
}
} else {
lockInfo = new LockInfo(null, getTimeout(), isDeep);
}
return lockInfo;
}