Use a different getRelativePath() for the API handlers, since they are designed to...
authorpastith <devnull@localhost>
Fri, 8 May 2009 08:58:58 +0000 (08:58 +0000)
committerpastith <devnull@localhost>
Fri, 8 May 2009 08:58:58 +0000 (08:58 +0000)
gss/src/gr/ebs/gss/server/rest/RequestHandler.java

index 8a21fb8..12a7f06 100644 (file)
@@ -698,4 +698,22 @@ public class RequestHandler extends Webdav {
                Boolean attr = (Boolean) req.getAttribute(AUTH_DEFERRED_ATTR);
                return attr == null? false: attr;
        }
+
+       /**
+        * Return the actual requested path in the API namespace.
+        *
+        * @param request the servlet request we are processing
+        * @return the relative path
+        */
+       @Override
+       protected String getRelativePath(HttpServletRequest request) {
+               // Remove the servlet path from the request URI.
+               String p = request.getRequestURI();
+               String servletPath = request.getContextPath() + request.getServletPath();
+               String result = p.substring(servletPath.length());
+               if (result == null || result.equals(""))
+                       result = "/";
+               return result;
+
+       }
 }