开发者

Downloading and decompress a zip-file in the background?

开发者 https://www.devze.com 2023-01-22 10:36 出处:网络
I need to download a zip file and unpack it, in the background (in an AsyncTask I\'d imagine). As it is now, I\'ve got a DefaultHTTPClient set up, and a ZipInputStream ready to go, but here\'s where

I need to download a zip file and unpack it, in the background (in an AsyncTask I'd imagine).

As it is now, I've got a DefaultHTTPClient set up, and a ZipInputStream ready to go, but here's where I am stuck - I have no idea how to use these two together. Here's the relevant code in the AsyncTask:

DefaultHttpClient http = new DefaultHttpClient();

        HttpGet method = new HttpGet("http://tf2b.com/downloads/imgshugo.zip");
        //method.addHeader("Accept-Encoding", "gzip");
        HttpResponse res = http.execute(method);

        InputStream is = res.getEntity().getContent();
        ZipInputStream zip = new ZipInputStream(is);
开发者_如何学Python

The last line there I'm not sure about at all, even. Any help would be appreciated!


http://www.exampledepot.com/search/luceneapi_node/zip

0

精彩评论

暂无评论...
验证码 换一张
取 消