jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r703175 - in /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav: jcr/AbstractItemResource.java jcr/AbstractResource.java jcr/DefaultItemCollection.java simple/DavResourceImpl.java simple/DeltaVResourceImpl.java
Date Thu, 09 Oct 2008 14:44:24 GMT
Author: reschke
Date: Thu Oct  9 07:44:24 2008
New Revision: 703175

URL: http://svn.apache.org/viewvc?rev=703175&view=rev
Log:
JCR-1795: advertise RFC 4918 compliance (compliance class 3), clean up code handling compliance
classes, add support in OptionsMethod, add test case

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java?rev=703175&r1=703174&r2=703175&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractItemResource.java
Thu Oct  9 07:44:24 2008
@@ -87,8 +87,12 @@
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
     public String getComplianceClass() {
-        String cc = super.getComplianceClass() + "," + DavCompliance.OBSERVATION;
-        return cc;
+        return DavCompliance.concatComplianceClasses(
+            new String[] {
+                super.getComplianceClass(),
+                DavCompliance.OBSERVATION,
+            }
+        );
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java?rev=703175&r1=703174&r2=703175&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
Thu Oct  9 07:44:24 2008
@@ -93,6 +93,7 @@
         DavCompliance.concatComplianceClasses(new String[] {
         DavCompliance._1_,
         DavCompliance._2_,
+        DavCompliance._3_,
         DavCompliance.VERSION_CONTROL,
         DavCompliance.VERSION_HISTORY,
         DavCompliance.CHECKOUT_IN_PLACE,

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java?rev=703175&r1=703174&r2=703175&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Thu Oct  9 07:44:24 2008
@@ -16,9 +16,42 @@
  */
 package org.apache.jackrabbit.webdav.jcr;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.lock.Lock;
+import javax.jcr.nodetype.NodeType;
+import javax.xml.parsers.ParserConfigurationException;
+
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.server.io.IOUtil;
 import org.apache.jackrabbit.util.Text;
+import org.apache.jackrabbit.webdav.DavCompliance;
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
@@ -28,15 +61,14 @@
 import org.apache.jackrabbit.webdav.DavResourceLocator;
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.apache.jackrabbit.webdav.io.InputContext;
 import org.apache.jackrabbit.webdav.io.OutputContext;
 import org.apache.jackrabbit.webdav.jcr.lock.JcrActiveLock;
 import org.apache.jackrabbit.webdav.jcr.lock.SessionScopedLockEntry;
 import org.apache.jackrabbit.webdav.jcr.nodetype.NodeTypeProperty;
+import org.apache.jackrabbit.webdav.jcr.property.ValuesProperty;
 import org.apache.jackrabbit.webdav.jcr.version.report.ExportViewReport;
 import org.apache.jackrabbit.webdav.jcr.version.report.LocateCorrespondingNodeReport;
-import org.apache.jackrabbit.webdav.jcr.property.ValuesProperty;
 import org.apache.jackrabbit.webdav.lock.ActiveLock;
 import org.apache.jackrabbit.webdav.lock.LockInfo;
 import org.apache.jackrabbit.webdav.lock.Scope;
@@ -52,43 +84,12 @@
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
 import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
 import org.apache.jackrabbit.webdav.property.HrefProperty;
+import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 
-import javax.jcr.AccessDeniedException;
-import javax.jcr.ImportUUIDBehavior;
-import javax.jcr.Item;
-import javax.jcr.ItemExistsException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.lock.Lock;
-import javax.jcr.nodetype.NodeType;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.List;
-
 /**
  * <code>DefaultItemCollection</code> represents a JCR node item.
  */
@@ -120,9 +121,12 @@
     public String getComplianceClass() {
         String cc = super.getComplianceClass();
         if (isOrderable()) {
-            StringBuffer sb = new StringBuffer(cc);
-            sb.append(", ").append(OrderingResource.COMPLIANCE_CLASS);
-            return sb.toString();
+            return DavCompliance.concatComplianceClasses(
+                new String[] {
+                    cc,
+                    DavCompliance.ORDERED_COLLECTIONS,
+                }
+            );
         } else {
             return cc;
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=703175&r1=703174&r2=703175&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Thu Oct  9 07:44:24 2008
@@ -30,6 +30,7 @@
 import org.apache.jackrabbit.server.io.PropertyExportContext;
 import org.apache.jackrabbit.server.io.PropertyImportContext;
 import org.apache.jackrabbit.util.Text;
+import org.apache.jackrabbit.webdav.DavCompliance;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceFactory;
@@ -97,8 +98,16 @@
     private static final Logger log = LoggerFactory.getLogger(DavResourceImpl.class);
 
     public static final String METHODS = DavResource.METHODS + ", " + BindConstants.METHODS;
-    public static final String COMPLIANCE_CLASS = DavResource.COMPLIANCE_CLASS + ", " + BindConstants.COMPLIANCE_CLASS;
 
+    public static final String COMPLIANCE_CLASSES = DavCompliance.concatComplianceClasses(
+        new String[] {
+            DavCompliance._1_,
+            DavCompliance._2_,
+            DavCompliance._3_,
+            DavCompliance.BIND
+        }
+    );
+    
     private DavResourceFactory factory;
     private LockManager lockManager;
     private JcrDavSession session;
@@ -109,7 +118,7 @@
     protected boolean propsInitialized = false;
     private boolean isCollection = true;
     private String rfc4122Uri;
-
+    
     private ResourceConfig config;
     private long modificationTime = IOUtil.UNDEFINED_TIME;
 
@@ -221,11 +230,10 @@
     }
 
     /**
-     * @return DavResource#COMPLIANCE_CLASS
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
     public String getComplianceClass() {
-        return COMPLIANCE_CLASS;
+        return COMPLIANCE_CLASSES;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java?rev=703175&r1=703174&r2=703175&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DeltaVResourceImpl.java
Thu Oct  9 07:44:24 2008
@@ -24,6 +24,7 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.webdav.DavCompliance;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavLocatorFactory;
 import org.apache.jackrabbit.webdav.DavResource;
@@ -31,8 +32,6 @@
 import org.apache.jackrabbit.webdav.DavResourceLocator;
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.DavSession;
-import org.apache.jackrabbit.webdav.DavCompliance;
-import org.apache.jackrabbit.webdav.bind.BindConstants;
 import org.apache.jackrabbit.webdav.property.DavProperty;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.HrefProperty;
@@ -48,7 +47,7 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The <code>DeltaVResourceImpl</code> encapsultes the functionality common to
all
+ * The <code>DeltaVResourceImpl</code> encapsulates the functionality common
to all
  * DeltaV compliant resources.
  */
 public class DeltaVResourceImpl extends DavResourceImpl implements DeltaVResource {
@@ -56,6 +55,12 @@
     protected SupportedReportSetProperty supportedReports = new SupportedReportSetProperty();
     private static final Logger log = LoggerFactory.getLogger(DeltaVResourceImpl.class);
 
+    private static final String DELTAV_COMPLIANCE_CLASSES = DavCompliance.concatComplianceClasses(
+        new String[] {
+            DavResourceImpl.COMPLIANCE_CLASSES,
+            DavCompliance.BIND,
+        }
+    );
 
     public DeltaVResourceImpl(DavResourceLocator locator, DavResourceFactory factory, DavSession
session, ResourceConfig config, Item item) throws DavException {
         super(locator, factory, session, config, (Node)item);
@@ -69,18 +74,10 @@
 
     //---------------------------------------------------------< DavResource>---
     /**
-     * @return DavResource#COMPLIANCE_CLASS
      * @see org.apache.jackrabbit.webdav.DavResource#getComplianceClass()
      */
     public String getComplianceClass() {
-        return DavCompliance.concatComplianceClasses(new String[] {
-                DavCompliance._1_,
-                DavCompliance._2_,
-                DavCompliance.VERSION_CONTROL,
-                DavCompliance.VERSION_HISTORY,
-                DavCompliance.LABEL,
-                BindConstants.COMPLIANCE_CLASS,
-        });
+        return DELTAV_COMPLIANCE_CLASSES;
     }
 
     //------------------------------------------------------< DeltaVResource>---



Mime
View raw message