|
|
@ -228,15 +228,15 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable { |
|
|
|
mTaskWrapper.setNewTask(true); |
|
|
|
mTaskWrapper.setNewTask(true); |
|
|
|
mTaskWrapper.setSupportBP(false); |
|
|
|
mTaskWrapper.setSupportBP(false); |
|
|
|
end = true; |
|
|
|
end = true; |
|
|
|
} else if (code == HttpURLConnection.HTTP_NOT_FOUND) { |
|
|
|
} else if (code == HttpURLConnection.HTTP_MOVED_TEMP |
|
|
|
failDownload(new AriaHTTPException(TAG, |
|
|
|
|
|
|
|
String.format("任务下载失败,errorCode:404, url: %s", mEntity.getUrl())), false); |
|
|
|
|
|
|
|
} else if (code == HttpURLConnection.HTTP_MOVED_TEMP |
|
|
|
|
|
|
|
|| code == HttpURLConnection.HTTP_MOVED_PERM |
|
|
|
|| code == HttpURLConnection.HTTP_MOVED_PERM |
|
|
|
|| code == HttpURLConnection.HTTP_SEE_OTHER |
|
|
|
|| code == HttpURLConnection.HTTP_SEE_OTHER |
|
|
|
|| code == HttpURLConnection.HTTP_CREATED // 201 跳转
|
|
|
|
|| code == HttpURLConnection.HTTP_CREATED // 201 跳转
|
|
|
|
|| code == 307) { |
|
|
|
|| code == 307) { |
|
|
|
handleUrlReTurn(conn, conn.getHeaderField("Location")); |
|
|
|
handleUrlReTurn(conn, conn.getHeaderField("Location")); |
|
|
|
|
|
|
|
} else if (code >= HttpURLConnection.HTTP_BAD_REQUEST) { |
|
|
|
|
|
|
|
failDownload(new AriaHTTPException(TAG, |
|
|
|
|
|
|
|
String.format("任务下载失败,errorCode:%s, url: %s", code, mEntity.getUrl())), false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
failDownload(new AriaHTTPException(TAG, |
|
|
|
failDownload(new AriaHTTPException(TAG, |
|
|
|
String.format("任务下载失败,errorCode:%s, errorMsg: %s, url: %s", code, |
|
|
|
String.format("任务下载失败,errorCode:%s, errorMsg: %s, url: %s", code, |
|
|
|