abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r429841 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java
Date Tue, 08 Aug 2006 21:55:04 GMT
Author: jmsnell
Date: Tue Aug  8 14:55:04 2006
New Revision: 429841

URL: http://svn.apache.org/viewvc?rev=429841&view=rev
Log:
Bug: wasn't setting the URI for post, put and extension methods

Modified:
    incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java

Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java?rev=429841&r1=429840&r2=429841&view=diff
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java
(original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/util/MethodHelper.java
Tue Aug  8 14:55:04 2006
@@ -25,6 +25,7 @@
 import org.apache.abdera.protocol.client.RequestOptions;
 import org.apache.abdera.protocol.client.Response;
 import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.URI;
 import org.apache.commons.httpclient.methods.DeleteMethod;
 import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
 import org.apache.commons.httpclient.methods.GetMethod;
@@ -128,13 +129,13 @@
       HttpMethod httpMethod = null;
       switch(m) {
         case GET:     httpMethod = new GetMethod(uri); break;
-        case POST:    httpMethod = getMethod(new PostMethod(), entity); break;
-        case PUT:     httpMethod = getMethod(new PutMethod(), entity); break;
+        case POST:    httpMethod = getMethod(new PostMethod(uri), entity); break;
+        case PUT:     httpMethod = getMethod(new PutMethod(uri), entity); break;
         case DELETE:  httpMethod = new DeleteMethod(uri); break;
         case HEAD:    httpMethod = new HeadMethod(uri); break;
         case OPTIONS: httpMethod = new OptionsMethod(uri); break;
         case TRACE:   httpMethod = new TraceMethod(uri); break;
-        default:      httpMethod = getMethod(new ExtensionMethod(method), entity);
+        default:      httpMethod = getMethod(new ExtensionMethod(method,uri), entity);
       }
       initHeaders(options, httpMethod);
       return httpMethod;
@@ -156,8 +157,11 @@
   public static final class ExtensionMethod 
     extends EntityEnclosingMethod {
     private String method = null;
-    public ExtensionMethod(String method) {
+    public ExtensionMethod(String method, String uri) {
       super(method);
+      try {
+        this.setURI(new URI(uri, false));
+      } catch (Exception e) {}
       this.method = method;
     }
     @Override



Mime
View raw message