* @throws DavException
*/
protected void doLock(WebdavRequest request, WebdavResponse response,
DavResource resource) throws IOException, DavException {
LockInfo lockInfo = request.getLockInfo();
if (lockInfo.isRefreshLock()) {
// refresh any matching existing locks
ActiveLock[] activeLocks = resource.getLocks();
List lList = new ArrayList();
for (int i = 0; i < activeLocks.length; i++) {
// adjust lockinfo with type/scope retrieved from the lock.
lockInfo.setType(activeLocks[i].getType());
lockInfo.setScope(activeLocks[i].getScope());
DavProperty etagProp = resource.getProperty(DavPropertyName.GETETAG);
String etag = etagProp != null ? String.valueOf(etagProp.getValue()) : "";
if (request.matchesIfHeader(resource.getHref(), activeLocks[i].getToken(), etag)) {
lList.add(resource.refreshLock(lockInfo, activeLocks[i].getToken()));