chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1097392 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java
Date Thu, 28 Apr 2011 10:01:34 GMT
Author: fmui
Date: Thu Apr 28 10:01:34 2011
New Revision: 1097392

URL: http://svn.apache.org/viewvc?rev=1097392&view=rev
Log:
decompress error messages

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java?rev=1097392&r1=1097391&r2=1097392&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/HttpUtils.java
Thu Apr 28 10:01:34 2011
@@ -227,6 +227,18 @@ public class HttpUtils {
                     StringBuilder sb = new StringBuilder();
 
                     try {
+                        String encoding = getContentEncoding();
+                        if (encoding != null) {
+                            if (encoding.toLowerCase().trim().equals("gzip")) {
+                                try {
+                                    errorStream = new GZIPInputStream(errorStream, 4096);
+                                } catch (IOException e) {
+                                }
+                            } else if (encoding.toLowerCase().trim().equals("deflate")) {
+                                errorStream = new InflaterInputStream(errorStream, new Inflater(true),
4096);
+                            }
+                        }
+
                         InputStreamReader reader = new InputStreamReader(errorStream);
                         char[] buffer = new char[4096];
                         int b;



Mime
View raw message