jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r397821 - /jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatusResponse.java
Date Fri, 28 Apr 2006 09:27:33 GMT
Author: angela
Date: Fri Apr 28 02:27:03 2006
New Revision: 397821

URL: http://svn.apache.org/viewcvs?rev=397821&view=rev
Log:
MulitStatusResponse: allow to retrieve available status entries.

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

Modified: jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatusResponse.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatusResponse.java?rev=397821&r1=397820&r2=397821&view=diff
==============================================================================
--- jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatusResponse.java
(original)
+++ jackrabbit/trunk/jcr-server/webdav/src/java/org/apache/jackrabbit/webdav/MultiStatusResponse.java
Fri Apr 28 02:27:03 2006
@@ -214,8 +214,31 @@
     }
 
     /**
-     * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(org.w3c.dom.Document)
+     * Return an array listing all 'status' available is this response object.
+     * Note, that a the array contains a single element if this
+     * <code>MultiStatusResponse</code> defines an response consisting of
+     * href and status elements.
+     *
+     * @return
+     */
+    public Status[] getStatus() {
+        Status[] sts;
+        if (type == TYPE_PROPSTAT) {
+            sts = new Status[statusMap.size()];
+            Iterator iter = statusMap.keySet().iterator();
+            for (int i = 0; iter.hasNext(); i++) {
+                Integer statusKey = (Integer) iter.next();
+                sts[i] = new Status(statusKey.intValue());
+            }
+        } else {
+            sts = new Status[] {status};
+        }
+        return sts;
+    }
+
+    /**
      * @param document
+     * @see org.apache.jackrabbit.webdav.xml.XmlSerializable#toXml(org.w3c.dom.Document)
      */
     public Element toXml(Document document) {
         Element response = DomUtil.createElement(document, XML_RESPONSE, NAMESPACE);
@@ -430,4 +453,4 @@
     private static boolean isValidHref(String href) {
         return href != null && !"".equals(href);
     }
-}
\ No newline at end of file
+}



Mime
View raw message