Retry transactions in the face of optimistic locking exceptions for all "write" trans...
[pithos] / src / gr / ebs / gss / server / rest / RequestHandler.java
index 1361210..5f21bf9 100644 (file)
@@ -184,7 +184,7 @@ public class RequestHandler extends Webdav {
                                        ", " + METHOD_DELETE);
                methodsAllowed.put(PATH_OTHERS, METHOD_GET);
                methodsAllowed.put(PATH_SEARCH, METHOD_GET);
-               methodsAllowed.put(PATH_USERS, METHOD_GET + ", " + METHOD_POST);
+               methodsAllowed.put(PATH_USERS, METHOD_GET);
                methodsAllowed.put(PATH_SHARED, METHOD_GET);
                methodsAllowed.put(PATH_TAGS, METHOD_GET);
                methodsAllowed.put(PATH_TRASH, METHOD_GET + ", " + METHOD_DELETE);
@@ -449,9 +449,10 @@ public class RequestHandler extends Webdav {
                } else if (path.startsWith(PATH_SEARCH)) {
             resp.addHeader("Allow", methodsAllowed.get(PATH_SEARCH));
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
-               } else if (path.startsWith(PATH_USERS))
-                       new UserHandler().postUser(req, resp);
-               else if (path.startsWith(PATH_SHARED)) {
+               } else if (path.startsWith(PATH_USERS)) {
+                       resp.addHeader("Allow", methodsAllowed.get(PATH_USERS));
+                       resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+               } else if (path.startsWith(PATH_SHARED)) {
             resp.addHeader("Allow", methodsAllowed.get(PATH_SHARED));
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
                } else if (path.startsWith(PATH_TAGS)) {
@@ -464,6 +465,8 @@ public class RequestHandler extends Webdav {
                        resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
                } else if (path.startsWith(PATH_FILES))
                        new FilesHandler(getServletContext()).postResource(req, resp);
+               else if (path.equals("/"))
+                       new UserHandler().postUser(req, resp);
                else
                resp.sendError(HttpServletResponse.SC_NOT_FOUND, req.getRequestURI());
        }