* @exception ResourceException If the resource got a fatal error.
*/
public synchronized Reply lock(DAVRequest request)
throws ProtocolException, ResourceException
{
DAVBody body = getBody(request);
if (body == null) { // refresh?
if (debug) {
System.out.println(">>> Refreshing lock...");
}
refreshLock(request.getTimeout());
Document doc = DAVBody.createDocument(DAVNode.PROP_NODE);
addLockDiscovery(request, doc.getDocumentElement());
Reply ok = createDAVReply(request, HTTP.OK, doc);
return ok;
} else { // real new lock
String timeouts[] = request.getTimeout();
DAVLockInfo lockinfo = body.getLockInfo();
if (lockinfo != null) {
Node owner = lockinfo.getOwner();
lock(getNewLockToken(),
request.getDepth(),
request.getTimeout(),