You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2001/03/22 17:09:36 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method UnlockMethod.java
juergen 01/03/22 08:09:36
Modified: src/webdav/server/org/apache/slide/webdav/method
UnlockMethod.java
Log:
added error handling for unlock, copied from the get method.
Revision Changes Path
1.5 +29 -9 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- UnlockMethod.java 2001/02/11 20:39:25 1.4
+++ UnlockMethod.java 2001/03/22 16:09:35 1.5
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v 1.4 2001/02/11 20:39:25 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2001/02/11 20:39:25 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnlockMethod.java,v 1.5 2001/03/22 16:09:35 juergen Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/03/22 16:09:35 $
*
* ====================================================================
*
@@ -112,7 +112,7 @@
*/
public UnlockMethod(GenericServlet servlet, NamespaceAccessToken token,
HttpServletRequest req, HttpServletResponse resp) {
- super(servlet, token, req, resp);
+ super(servlet, token, req, resp);
}
@@ -125,13 +125,13 @@
* @exception WebdavException Bad request
*/
protected void parseRequest()
- throws WebdavException {
+ throws WebdavException {
// Loads the associated object from the store.
- toUnlock = requestUri;
- if (toUnlock == null) {
- toUnlock = "/";
- }
+ toUnlock = requestUri;
+ if (toUnlock == null) {
+ toUnlock = "/";
+ }
String lockTokenHeader = req.getHeader("Lock-Token");
if (lockTokenHeader != null) {
@@ -180,6 +180,26 @@
resp.setStatus(WebdavStatus.SC_NO_CONTENT);
+ } catch (RevisionDescriptorNotFoundException e) {
+ // 404 - Not found
+ System.out.println(e.getMessage());
+ resp.setStatus(WebdavStatus.SC_NOT_FOUND);
+ } catch (ObjectNotFoundException e) {
+ // 404 - Not found
+ resp.setStatus(WebdavStatus.SC_NOT_FOUND);
+ } catch (LinkedObjectNotFoundException e) {
+ // 404 - Not found
+ System.out.println(e.getMessage());
+ resp.setStatus(WebdavStatus.SC_NOT_FOUND);
+ } catch (AccessDeniedException e) {
+ // 403 - Forbidden
+ System.out.println(e.getMessage());
+ resp.setStatus(WebdavStatus.SC_FORBIDDEN);
+ } catch (ServiceAccessException e) {
+ // 500 - Internal server error
+ System.out.println(e.getMessage());
+ resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
+ throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
} catch (SlideException e) {
e.printStackTrace();
resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);