dirkv 01/08/24 13:16:39
Modified: src/webdav/client/src/org/apache/webdav/lib
BaseProperty.java
Log:
A response can have multiple propstat elements each with
their own status, return the (mandatory) status before asking
the resoponse for its status
Thanks to Robert Owen for helping with this bug
Revision Changes Path
1.2 +27 -4
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/BaseProperty.java
Index: BaseProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/BaseProperty.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BaseProperty.java 2001/05/13 22:32:30 1.1
+++ BaseProperty.java 2001/08/24 20:16:39 1.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/BaseProperty.java,v
1.1 2001/05/13 22:32:30 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2001/05/13 22:32:30 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/BaseProperty.java,v
1.2 2001/08/24 20:16:39 dirkv Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/08/24 20:16:39 $
*
* ====================================================================
*
@@ -74,7 +74,7 @@
* This interface models a DAV property.
*
* @author Remy Maucherat
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class BaseProperty implements Property {
@@ -169,6 +169,29 @@
* This method returns the status code associated with the property.
*/
public int getStatusCode() {
+ // A response can have multiple propstat elements each with
+ // their own status, return the (mandatory) status before asking
+ // the resoponse for its status
+
+ // <multistatus xmlns=\DAV:\>
+ // <response>
+ // <href>/slide/files/</href>
+ // <propstat>
+ // <prop><displayname>files</displayname></prop>
+ // <status>HTTP/1.1 200 OK</status>
+ // </propstat>
+ // <propstat>
+ // <prop><displayname>files</displayname></prop>
+ // <status>HTTP/1.1 200 OK</status>
+ // </propstat>
+ // </response>
+ // </multistatus>
+
+ Element status =
DOMUtils.getFirstElement(element.getParentNode().getParentNode(),"DAV:", "status");
+ if (status != null) {
+ return DOMUtils.parseStatus(DOMUtils.getTextValue(status));
+ }
+
return response.getStatusCode();
}