Loading src/com/owncloud/android/lib/common/method/GzipedPropfind.java +9 −9 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package com.owncloud.android.lib.common.method; import org.apache.commons.httpclient.Header; import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; import org.apache.jackrabbit.webdav.xml.DomUtil; Loading @@ -42,21 +43,23 @@ public class GzipedPropfind extends PropFindMethod { } /* * @inherited; * Uncompress the gzipSteam before to parse it with SAX * In the case of no "Content-Encoding:gzip" headers is found, the * */ @Override public Document getResponseBodyAsDocument() throws IOException { if(getResponseHeader("Content-Encoding").getValue() != "gzip") { Header contentEncodingHeader= getResponseHeader("Content-Encoding"); if(contentEncodingHeader != null && contentEncodingHeader.getValue() != "gzip") { return super.getResponseBodyAsDocument(); } //@TOdo: look for potential optimisation like pipe gzipInputStream directly in InputStream in GZIPInputStream gzipis = null; gzipis = new GZIPInputStream(getResponseBodyAsStream()); GZIPInputStream gzipis = new GZIPInputStream(getResponseBodyAsStream()); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gzipis)); StringBuilder s = new StringBuilder(); String line = null; String line; while( (line =bufferedReader.readLine()) != null) { s.append(line); } Loading @@ -83,7 +86,6 @@ public class GzipedPropfind extends PropFindMethod { return null; } public GzipedPropfind(String uri, DavPropertyNameSet propNameSet, int depth) throws IOException { super(uri, propNameSet, depth); } Loading @@ -95,6 +97,4 @@ public class GzipedPropfind extends PropFindMethod { public GzipedPropfind(String uri, int propfindType, DavPropertyNameSet propNameSet, int depth) throws IOException { super(uri, propfindType, propNameSet, depth); } } Loading
src/com/owncloud/android/lib/common/method/GzipedPropfind.java +9 −9 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package com.owncloud.android.lib.common.method; import org.apache.commons.httpclient.Header; import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; import org.apache.jackrabbit.webdav.xml.DomUtil; Loading @@ -42,21 +43,23 @@ public class GzipedPropfind extends PropFindMethod { } /* * @inherited; * Uncompress the gzipSteam before to parse it with SAX * In the case of no "Content-Encoding:gzip" headers is found, the * */ @Override public Document getResponseBodyAsDocument() throws IOException { if(getResponseHeader("Content-Encoding").getValue() != "gzip") { Header contentEncodingHeader= getResponseHeader("Content-Encoding"); if(contentEncodingHeader != null && contentEncodingHeader.getValue() != "gzip") { return super.getResponseBodyAsDocument(); } //@TOdo: look for potential optimisation like pipe gzipInputStream directly in InputStream in GZIPInputStream gzipis = null; gzipis = new GZIPInputStream(getResponseBodyAsStream()); GZIPInputStream gzipis = new GZIPInputStream(getResponseBodyAsStream()); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(gzipis)); StringBuilder s = new StringBuilder(); String line = null; String line; while( (line =bufferedReader.readLine()) != null) { s.append(line); } Loading @@ -83,7 +86,6 @@ public class GzipedPropfind extends PropFindMethod { return null; } public GzipedPropfind(String uri, DavPropertyNameSet propNameSet, int depth) throws IOException { super(uri, propNameSet, depth); } Loading @@ -95,6 +97,4 @@ public class GzipedPropfind extends PropFindMethod { public GzipedPropfind(String uri, int propfindType, DavPropertyNameSet propNameSet, int depth) throws IOException { super(uri, propfindType, propNameSet, depth); } }