public interface Downloader
| Modifier and Type | Method and Description |
|---|---|
<T> Future<T> |
download(DownloadTask<T> task,
DownloadCallback<T> callback)
Submits a download task asynchronously.
|
<T> Future<T> |
download(DownloadTask<T> task,
DownloadCallback<T> callback,
int tries)
Submits a download task asynchronously.
|
<T> Future<T> download(DownloadTask<T> task, DownloadCallback<T> callback)
T - the result of the tasktask - the download taskcallback - download callbackNullPointerException - task == nullRejectedExecutionException - if the downloader has been shutdown<T> Future<T> download(DownloadTask<T> task, DownloadCallback<T> callback, int tries)
The task will be retried only when an IOException occurs.
tries is the max number of tries. For example: If tries==1, the download won't be
retried
(try 1 time, retry 0 time); If tries==5, the download will be retried at most 4 times.
T - the result of the tasktask - the download taskcallback - download callbacktries - the max number of triesNullPointerException - task == nullIllegalArgumentException - if tries < 1RejectedExecutionException - if the downloader has been shutdownCopyright © 2016. All rights reserved.