luetzkendorf 2004/09/12 10:35:50
Modified: src/webdav/server/org/apache/slide/webdav/method Tag:
SLIDE_2_1_RELEASE_BRANCH UnlockMethod.java
Log:
error handling; status code chaged to 204 for LOCKs that starts external transactions
Revision Changes Path
No revision
No revision
1.39.2.1 +21 -6
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java
Index: UnlockMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -r1.39 -r1.39.2.1
--- UnlockMethod.java 3 Aug 2004 09:37:47 -0000 1.39
+++ UnlockMethod.java 12 Sep 2004 17:35:50 -0000 1.39.2.1
@@ -147,12 +147,25 @@
command =
COMMIT_TRANSACTION;
} else if
(E_ABORT.equals(action.getName())) {
command =
ABORT_TRANSACTION;
- }
- }
+ } else {
+ sendError(WebdavStatus.SC_BAD_REQUEST,
+ "transactionstatus must be one of commit or abort");
+ throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
+ }
+ } else {
+
sendError(WebdavStatus.SC_BAD_REQUEST,
+ "transactionstatus must contain one of commit or abort");
+ throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
+ }
}
}
}
- } catch (Exception exception) {
+ }
+ catch (WebdavException e) {
+ throw e;
+ }
+ catch (Exception exception) {
+ sendError(WebdavStatus.SC_BAD_REQUEST, exception);
throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
}
}
@@ -196,6 +209,8 @@
}
}
ExternalTransactionContext.deregisterContext(lockId);
+
+ resp.setStatus(WebdavStatus.SC_NO_CONTENT);
} else {
try {
if (WebdavEvent.UNLOCK.isEnabled())
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]