下载的代码如下:
HttpURLConnection httpConn = null;
URL url = new URL(Splitter.on("?").splitToList(file.getFileUrl()).get(0));
httpConn = (HttpURLConnection) url.openConnection();
httpConn.connect();
InputStream is = httpConn.getInputStream();
zos.putNextEntry(new ZipEntry(folderName + "/" + file.getName()));
int length;
while ((length = is.read(buffer)) > 0) {
zos.write(buffer, 0, length);
}
is.close();