@@ -42,9 +42,6 @@ public class HttpHandler<T> extends PriorityAsyncTask<Object, Object, Void> impl
42
42
private final AbstractHttpClient client ;
43
43
private final HttpContext context ;
44
44
45
- private final StringDownloadHandler mStringDownloadHandler = new StringDownloadHandler ();
46
- private final FileDownloadHandler mFileDownloadHandler = new FileDownloadHandler ();
47
-
48
45
private HttpRedirectHandler httpRedirectHandler ;
49
46
50
47
public void setHttpRedirectHandler (HttpRedirectHandler httpRedirectHandler ) {
@@ -242,9 +239,11 @@ private ResponseInfo<T> handleResponse(HttpResponse response) throws HttpExcepti
242
239
if (isDownloadingFile ) {
243
240
autoResume = autoResume && OtherUtils .isSupportRange (response );
244
241
String responseFileName = autoRename ? OtherUtils .getFileNameFromHttpResponse (response ) : null ;
245
- result = mFileDownloadHandler .handleEntity (entity , this , fileSavePath , autoResume , responseFileName );
242
+ FileDownloadHandler downloadHandler = new FileDownloadHandler ();
243
+ result = downloadHandler .handleEntity (entity , this , fileSavePath , autoResume , responseFileName );
246
244
} else {
247
- result = mStringDownloadHandler .handleEntity (entity , this , charset );
245
+ StringDownloadHandler downloadHandler = new StringDownloadHandler ();
246
+ result = downloadHandler .handleEntity (entity , this , charset );
248
247
if (HttpUtils .sHttpCache .isEnabled (requestMethod )) {
249
248
HttpUtils .sHttpCache .put (requestUrl , (String ) result , expiry );
250
249
}
0 commit comments