[Bedework-commit] davutil r98 - trunk/davio/src/org/bedework/http/client/dav

svnadmin at bedework.org svnadmin at bedework.org
Mon Sep 6 21:59:40 EDT 2010


Author: douglm
Date: 2010-09-06 21:59:34 -0400 (Mon, 06 Sep 2010)
New Revision: 98

Modified:
   trunk/davio/src/org/bedework/http/client/dav/DavClient.java
Log:
Allow Depth header on all methods - enables use of X-HTTP-Method-Override

Modified: trunk/davio/src/org/bedework/http/client/dav/DavClient.java
===================================================================
--- trunk/davio/src/org/bedework/http/client/dav/DavClient.java	2010-07-28 20:20:53 UTC (rev 97)
+++ trunk/davio/src/org/bedework/http/client/dav/DavClient.java	2010-09-07 01:59:34 UTC (rev 98)
@@ -27,7 +27,6 @@
 
 import org.bedework.http.client.DavioBadResponse;
 import org.bedework.http.client.DavioException;
-import org.bedework.http.client.DepthHttpMethod;
 import org.bedework.http.client.HttpManager;
 
 import edu.rpi.sss.util.xml.XmlEmit;
@@ -54,6 +53,7 @@
 
 import sun.misc.BASE64Encoder;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Serializable;
@@ -187,8 +187,18 @@
 
     HttpMethod meth = client.getMethod();
 
-    if (meth instanceof DepthHttpMethod) {
-      ((DepthHttpMethod)meth).setDepth(depth);
+//    if (meth instanceof DepthHttpMethod) {
+  //    ((DepthHttpMethod)meth).setDepth(depth);
+    //}
+
+    if (depth != null) {
+      if ("0".equals(depth) ||
+          "1".equals(depth) ||
+          "infinity".equals(depth)) {
+        meth.setRequestHeader("Depth", depth);
+      } else {
+        throw new IOException("Illegal value for depth");
+      }
     }
 
     if (credentials != null) {



More information about the Bedework-commit mailing list