You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2006/10/05 22:51:11 UTC
svn commit: r453378 - in
/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client:
Client.java RequestOptions.java
Author: jmsnell
Date: Thu Oct 5 13:51:10 2006
New Revision: 453378
URL: http://svn.apache.org/viewvc?view=rev&rev=453378
Log:
Applying the patch provided by Ugo Cei. (http://issues.apache.org/jira/browse/ABDERA-10)
This allows us to specify whether to use chunked encoding via the request options.
Modified:
incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/Client.java
incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/Client.java?view=diff&rev=453378&r1=453377&r2=453378
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/Client.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/Client.java Thu Oct 5 13:51:10 2006
@@ -136,7 +136,7 @@
String uri,
Base base,
RequestOptions options) {
- return execute("POST", uri, new BaseRequestEntity(base), options);
+ return execute("POST", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
}
public ClientResponse put(
@@ -157,7 +157,7 @@
String uri,
Base base,
RequestOptions options) {
- return execute("PUT", uri, new BaseRequestEntity(base), options);
+ return execute("PUT", uri, new BaseRequestEntity(base, options.isUseChunked()), options);
}
public ClientResponse delete(
Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?view=diff&rev=453378&r1=453377&r2=453378
==============================================================================
--- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java (original)
+++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java Thu Oct 5 13:51:10 2006
@@ -39,6 +39,7 @@
private boolean noLocalCache = false;
private boolean revalidateAuth = false;
+ private boolean useChunked = true;
private final Map<String,List<String>> headers;
@@ -301,5 +302,19 @@
public void setRevalidateWithAuth(boolean revalidateAuth) {
this.revalidateAuth= revalidateAuth;
+ }
+
+ /**
+ * Should the request use chunked encoding?
+ */
+ public boolean isUseChunked() {
+ return useChunked;
+ }
+
+ /**
+ * Set whether the request should use chunked encoding.
+ */
+ public void setUseChunked(boolean useChunked) {
+ this.useChunked = useChunked;
}
}