Loading src/com/owncloud/android/lib/common/method/GzipedPropfind.java +14 −7 Original line number Diff line number Diff line Loading @@ -51,11 +51,12 @@ public class GzipedPropfind extends PropFindMethod { public Document getResponseBodyAsDocument() throws IOException { Header contentEncodingHeader= getResponseHeader("Content-Encoding"); if(contentEncodingHeader != null && contentEncodingHeader.getValue() != "gzip") { if(contentEncodingHeader != null && contentEncodingHeader.getValue().indexOf("gzip") != -1 ) { return super.getResponseBodyAsDocument(); } //@TOdo: look for potential optimisation like pipe gzipInputStream directly in InputStream in try{ GZIPInputStream gzipis = new GZIPInputStream(getResponseBodyAsStream()); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gzipis)); StringBuilder s = new StringBuilder(); Loading @@ -63,6 +64,12 @@ public class GzipedPropfind extends PropFindMethod { while ((line = bufferedReader.readLine()) != null) { s.append(line); } bufferedReader.close(); }catch(IOException e){ throw e; } InputStream in = new ByteArrayInputStream(s.toString().getBytes()); if (in != null) { Loading Loading
src/com/owncloud/android/lib/common/method/GzipedPropfind.java +14 −7 Original line number Diff line number Diff line Loading @@ -51,11 +51,12 @@ public class GzipedPropfind extends PropFindMethod { public Document getResponseBodyAsDocument() throws IOException { Header contentEncodingHeader= getResponseHeader("Content-Encoding"); if(contentEncodingHeader != null && contentEncodingHeader.getValue() != "gzip") { if(contentEncodingHeader != null && contentEncodingHeader.getValue().indexOf("gzip") != -1 ) { return super.getResponseBodyAsDocument(); } //@TOdo: look for potential optimisation like pipe gzipInputStream directly in InputStream in try{ GZIPInputStream gzipis = new GZIPInputStream(getResponseBodyAsStream()); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gzipis)); StringBuilder s = new StringBuilder(); Loading @@ -63,6 +64,12 @@ public class GzipedPropfind extends PropFindMethod { while ((line = bufferedReader.readLine()) != null) { s.append(line); } bufferedReader.close(); }catch(IOException e){ throw e; } InputStream in = new ByteArrayInputStream(s.toString().getBytes()); if (in != null) { Loading