- String repositoryName = extractRepositoryName(request);
- String pathPrefix = request.getServletPath() + '/' + repositoryName;
+ String pathInfo = request.getPathInfo();
+ String repositoryAlias = extractRepositoryAlias(pathInfo);
+ if (repositoryAlias.equals(""))
+ return null;
+
+ // MKCOL on repository or root node doesn't make sense
+ // and causes issues
+ if (request.getMethod().equals(MKCOL)) {
+ StringTokenizer st = new StringTokenizer(pathInfo, "/");
+ if (!st.hasMoreTokens())
+ return null;
+ st.nextToken();// repository
+ if (!st.hasMoreTokens())
+ return null;
+ st.nextToken();// workspace
+ if (!st.hasMoreTokens())
+ return null;
+ }
+
+ request.setAttribute(ArgeoJcrConstants.JCR_REPOSITORY_ALIAS,
+ repositoryAlias);
+ String pathPrefix = request.getServletPath() + '/' + repositoryAlias;