hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject svn commit: r1682651 - in /httpcomponents/httpclient/trunk/httpclient/src: main/java/org/apache/http/client/config/ main/java/org/apache/http/client/protocol/ test/java/org/apache/http/client/protocol/
Date Sat, 30 May 2015 20:22:46 GMT
Author: michaelo
Date: Sat May 30 20:22:46 2015
New Revision: 1682651

URL: http://svn.apache.org/r1682651
Log:
HTTPCLIENT-1654: Deprecate/remove RequestConfig#decompressionEnabled in favor of #contentCompressionEnabled

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseContentEncoding.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java?rev=1682651&r1=1682650&r2=1682651&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/RequestConfig.java
Sat May 30 20:22:46 2015
@@ -57,14 +57,13 @@ public class RequestConfig implements Cl
     private final int connectionRequestTimeout;
     private final int connectTimeout;
     private final int socketTimeout;
-    private final boolean decompressionEnabled;
     private final boolean contentCompressionEnabled;
 
     /**
      * Intended for CDI compatibility
     */
     protected RequestConfig() {
-        this(false, null, null, false, null, false, false, false, 0, false, null, null, 0,
0, 0, false, false);
+        this(false, null, null, false, null, false, false, false, 0, false, null, null, 0,
0, 0, false);
     }
 
     RequestConfig(
@@ -83,7 +82,6 @@ public class RequestConfig implements Cl
             final int connectionRequestTimeout,
             final int connectTimeout,
             final int socketTimeout,
-            final boolean decompressionEnabled,
             final boolean contentCompressionEnabled) {
         super();
         this.expectContinueEnabled = expectContinueEnabled;
@@ -100,7 +98,6 @@ public class RequestConfig implements Cl
         this.connectionRequestTimeout = connectionRequestTimeout;
         this.connectTimeout = connectTimeout;
         this.socketTimeout = socketTimeout;
-        this.decompressionEnabled = decompressionEnabled;
         this.contentCompressionEnabled = contentCompressionEnabled;
     }
 
@@ -290,18 +287,6 @@ public class RequestConfig implements Cl
     }
 
     /**
-     * Determines whether compressed entities should be decompressed automatically.
-     * <p>
-     * Default: {@code true}
-     * </p>
-     *
-     * @since 4.4
-     */
-    public boolean isDecompressionEnabled() {
-        return decompressionEnabled;
-    }
-
-    /**
      * Determines whether the target server is requested to compress content.
      * <p>
      * Default: {@code true}
@@ -336,7 +321,6 @@ public class RequestConfig implements Cl
         builder.append(", connectionRequestTimeout=").append(connectionRequestTimeout);
         builder.append(", connectTimeout=").append(connectTimeout);
         builder.append(", socketTimeout=").append(socketTimeout);
-        builder.append(", decompressionEnabled=").append(decompressionEnabled);
         builder.append(", contentCompressionEnabled=").append(contentCompressionEnabled);
         builder.append("]");
         return builder.toString();
@@ -362,7 +346,6 @@ public class RequestConfig implements Cl
             .setConnectionRequestTimeout(config.getConnectionRequestTimeout())
             .setConnectTimeout(config.getConnectTimeout())
             .setSocketTimeout(config.getSocketTimeout())
-            .setDecompressionEnabled(config.isDecompressionEnabled())
             .setContentCompressionEnabled(config.isContentCompressionEnabled());
     }
 
@@ -383,7 +366,6 @@ public class RequestConfig implements Cl
         private int connectionRequestTimeout;
         private int connectTimeout;
         private int socketTimeout;
-        private boolean decompressionEnabled;
         private boolean contentCompressionEnabled;
 
         Builder() {
@@ -396,7 +378,6 @@ public class RequestConfig implements Cl
             this.connectionRequestTimeout = -1;
             this.connectTimeout = -1;
             this.socketTimeout = -1;
-            this.decompressionEnabled = true;
             this.contentCompressionEnabled = true;
         }
 
@@ -470,11 +451,6 @@ public class RequestConfig implements Cl
             return this;
         }
 
-        public Builder setDecompressionEnabled(final boolean decompressionEnabled) {
-            this.decompressionEnabled = decompressionEnabled;
-            return this;
-        }
-
         public Builder setContentCompressionEnabled(final boolean contentCompressionEnabled)
{
             this.contentCompressionEnabled = contentCompressionEnabled;
             return this;
@@ -497,7 +473,6 @@ public class RequestConfig implements Cl
                     connectionRequestTimeout,
                     connectTimeout,
                     socketTimeout,
-                    decompressionEnabled,
                     contentCompressionEnabled);
         }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java?rev=1682651&r1=1682650&r2=1682651&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ResponseContentEncoding.java
Sat May 30 20:22:46 2015
@@ -129,7 +129,7 @@ public class ResponseContentEncoding imp
         final RequestConfig requestConfig = clientContext.getRequestConfig();
         // entity can be null in case of 304 Not Modified, 204 No Content or similar
         // check for zero length entity.
-        if (requestConfig.isDecompressionEnabled() && entity != null && entity.getContentLength()
!= 0) {
+        if (requestConfig.isContentCompressionEnabled() && entity != null &&
entity.getContentLength() != 0) {
             final Header ceheader = entity.getContentEncoding();
             if (ceheader != null) {
                 final HeaderElement[] codecs = ceheader.getElements();

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseContentEncoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseContentEncoding.java?rev=1682651&r1=1682650&r2=1682651&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseContentEncoding.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseContentEncoding.java
Sat May 30 20:22:46 2015
@@ -163,7 +163,7 @@ public class TestResponseContentEncoding
         response.setEntity(original);
 
         final RequestConfig config = RequestConfig.custom()
-                .setDecompressionEnabled(false)
+                .setContentCompressionEnabled(false)
                 .build();
 
         final HttpContext context = new BasicHttpContext();



Mime
View raw message