Is that really the only change that would be necessary to work with 4.0? I think it might be worth double-checking that all the tests pass with this change and when compiled against 4.0.
While I agree that it would be better for Google to be upgrading the version of HttpClient they're using, at the same time, there are a lot of Android developers and users that would benefit from having the caching module. I'm willing to spend a little time to investigate further and perhaps make a change like this if it's not going to compromise the codebase going forwards. At the same time, Craig: couldn't you just apply that diff yourself and run with a patched version of httpclient-cache in your apps, then wait until Google upgrades the HttpClient that's embedded in Android? Jon ........ Jon Moore Comcast Interactive Media On 11/3/11 2:32 PM, "candrews" <[email protected]> wrote: > >HttpClient-Cache doesn't work against HttpClient 4.0 because it uses >org.apache.http.util.EntityUtils.consume(org.apache.http.HttpEntity) which >wasn't introduced until HttpClient 4.1. > >Since Android uses HttpClient 4.0 (yes, it sucks that they won't upgrade, >and I don't understand their reasons for not upgrading, but anyways), this >means you can't use HttpClient-Cache on Android - and IMHO, it would be >really useful. > >Could HttpClient-Cache simply not use >org.apache.http.util.EntityUtils.consume and therefore set the minimum >HttpClient version to 4.0? The change seems quite simple - in >ResponseProtocolCompliance, use this method body instead of the existing >one: > > private void consumeBody(HttpResponse response) throws IOException { > HttpEntity body = response.getEntity(); > if (body != null){ > if (body.isStreaming()) { > InputStream instream = body.getContent(); > if (instream != null) { > instream.close(); > } > } > } > >Thank you, >~Craig >-- >View this message in context: >http://old.nabble.com/HttpClient-Cache-release-that-works-against-HttpClie >nt-4.0--tp32775131p32775131.html >Sent from the HttpClient-User mailing list archive at Nabble.com. > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [email protected] >For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
