jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r355450 - /incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
Date Fri, 09 Dec 2005 11:17:11 GMT
Author: angela
Date: Fri Dec  9 03:17:03 2005
New Revision: 355450

URL: http://svn.apache.org/viewcvs?rev=355450&view=rev
Log:
Adjusting utility methods: MKWORKSPACE is a 'createResource'-method and a 'createCollection'-method
too. 

RFC 3253:
"A workspace resource is a collection whose members are related version-controlled and non-version-controlled
resources."
"A MKWORKSPACE request creates a new workspace resource"

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java?rev=355450&r1=355449&r2=355450&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/DavMethods.java
Fri Dec  9 03:17:03 2005
@@ -289,23 +289,29 @@
     }
 
    /**
-     * Returns <code>true</code> if the request is to create a
-     * resource. True for <code>MKCOL</code>, <code>PUT</code> and
-     * <code>POST</code> requests.
+     * Returns <code>true</code> if the request is to create a resource.
+     * True for <code>PUT</code>, <code>POST</code>, <code>MKCOL</code>
+     * and <code>MKWORKSPACE</code> requests.
+     *
+     * @return true if request method is to create (or replace) a resource
      */
     public static boolean isCreateRequest(DavServletRequest request) {
         int methodCode = getMethodCode(request.getMethod());
-        return (methodCode == DAV_MKCOL ||
-                methodCode == DAV_PUT ||
-                methodCode == DAV_POST);
+        return ( methodCode == DAV_PUT ||
+                 methodCode == DAV_POST ||
+                 methodCode == DAV_MKCOL ||
+                 methodCode == DAV_MKWORKSPACE);
     }
 
     /**
-     * Returns <code>true</code> if the request is to create a
-     * collection resource. True for <code>MKCOL</code> requests.
+     * Returns <code>true</code> if the request is to create a collection resource.
+     * True for <code>MKCOL</code> and <code>MKWORKSPACE</code> requests.
+     *
+     * @return true if request method is to create a new collection resource
      */
     public static boolean isCreateCollectionRequest(DavServletRequest request) {
-        return (getMethodCode(request.getMethod()) == DAV_MKCOL);
+        int methodCode = getMethodCode(request.getMethod());
+        return (methodCode == DAV_MKCOL || methodCode == DAV_MKWORKSPACE);
     }
 
     /**



Mime
View raw message