jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r477562 - /jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java
Date Tue, 21 Nov 2006 08:01:30 GMT
Author: angela
Date: Tue Nov 21 00:01:29 2006
New Revision: 477562

URL: http://svn.apache.org/viewvc?view=rev&rev=477562
Log:
- avoid warning: don't access members of non-collection resources
- remember multistatus responses in linkedMap in order not to loose the order (used
  for responses to Search requests).

Modified:
    jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java

Modified: jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java?view=diff&rev=477562&r1=477561&r2=477562
==============================================================================
--- jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java
(original)
+++ jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatus.java
Tue Nov 21 00:01:29 2006
@@ -20,11 +20,12 @@
 import org.apache.jackrabbit.webdav.xml.DomUtil;
 import org.apache.jackrabbit.webdav.xml.ElementIterator;
 import org.apache.jackrabbit.webdav.xml.XmlSerializable;
+import org.apache.commons.collections.map.LinkedMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 /**
  * MultiStatus representing the content of a multistatus response body and
@@ -36,7 +37,7 @@
      * Map collecting the responses for this multistatus, where every href must
      * only occure one single time.
      */
-    private HashMap responses = new HashMap();
+    private Map responses = new LinkedMap();
 
     /**
      * A general response description at the multistatus top level is used to
@@ -59,7 +60,7 @@
     public void addResourceProperties(DavResource resource, DavPropertyNameSet propNameSet,
                                       int propFindType, int depth) {
         addResponse(new MultiStatusResponse(resource, propNameSet, propFindType));
-        if (depth > 0) {
+        if (depth > 0 && resource.isCollection()) {
             DavResourceIterator iter = resource.getMembers();
             while (iter.hasNext()) {
                 addResourceProperties(iter.nextResource(), propNameSet, propFindType, depth-1);
@@ -95,7 +96,7 @@
      */
     public void addResourceStatus(DavResource resource, int status, int depth) {
         addResponse(new MultiStatusResponse(resource.getHref(), status));
-        if (depth > 0) {
+        if (depth > 0 && resource.isCollection()) {
             DavResourceIterator iter = resource.getMembers();
             while (iter.hasNext()) {
                 addResourceStatus(iter.nextResource(), status, depth-1);



Mime
View raw message