resp.getWriter().write(errorMessage);
} catch(IOException ex) {
// Critical error ... Servlet container is dead or something
int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
sendError( statusCode, e );
throw new WebdavException( statusCode );
}
} else {
// Returning 207 on non-collection requests is generally
// considered bad. So let's not do it, since this way
// makes clients generally behave better.
resp.setStatus(WebdavStatus.SC_LOCKED);
}
//
// make sure the transaction is aborted
// throw any WebDAV exception to indicate the transaction wants to be aborted
//
throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
} catch (Exception e) {
int statusCode = getErrorCode( e );
sendError( statusCode, e );
throw new WebdavException( statusCode );
}
break;
case LOCK_REFRESH:
try {
Enumeration lockTokens =
lock.enumerateLocks(slideToken, lockInfo_lockSubject, false);
NodeLock currentLockToken = null;
Date newExpirationDate =
new Date((new Date()).getTime() + ((long)lockDuration * 1000L));
while (lockTokens.hasMoreElements()) {
currentLockToken = (NodeLock) lockTokens.nextElement();
lock.renew(slideToken, currentLockToken,
newExpirationDate);
}
showLockDiscoveryInfo(currentLockToken);
} catch (SlideException e) {
int statusCode = WebdavStatus.SC_PRECONDITION_FAILED;
sendError( statusCode, e );
throw new WebdavException( statusCode );
}
break;
}