添加timeout处理
This commit is contained in:
@ -45,10 +45,7 @@ public class DownloadThread extends Thread {
|
||||
}
|
||||
}
|
||||
|
||||
BufferedInputStream bis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
|
||||
FileOutputStream fileOutputStream = null;
|
||||
FileOutputStream fileOutputStream;
|
||||
if (targetFile.length() > 0) {
|
||||
fileOutputStream = new FileOutputStream(entry.getPath(), true);
|
||||
} else {
|
||||
@ -85,9 +82,9 @@ public class DownloadThread extends Thread {
|
||||
//设置自动重定向
|
||||
connection.setInstanceFollowRedirects(true);
|
||||
}
|
||||
|
||||
bis = new BufferedInputStream(connection.getInputStream());
|
||||
bos = new BufferedOutputStream(fileOutputStream);
|
||||
|
||||
BufferedInputStream bis = new BufferedInputStream(connection.getInputStream());
|
||||
BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);
|
||||
long conentLength = connection.getContentLength();
|
||||
String eTag = connection.getHeaderField("ETag");
|
||||
if (!TextUtils.isEmpty(eTag) && eTag.startsWith("\"") && eTag.endsWith("\"")) {
|
||||
|
||||
Reference in New Issue
Block a user