public class DownloadHttpClient extends Object
限定符 | 构造器和说明 |
---|---|
protected |
DownloadHttpClient(String group,
boolean safe) |
限定符和类型 | 方法和说明 |
---|---|
static DownloadHttpClient |
build(String group)
构造实例
|
static DownloadHttpClient |
build(String group,
boolean safe)
构造实例
|
void |
cancelAll()
取消所有
|
void |
cancelRequests(Object tag,
boolean mayInterruptIfRunning)
取消请求
|
void |
close() |
protected DownloadRetryHandler |
getDownloadRetryHandler() |
Future |
send(Object tag,
String url,
DownloadResponseHandler responseHandler,
long from,
String saveFile)
发起请求
|
protected Future |
sendRequest(Request urlRequest,
DownloadResponseHandler responseHandler,
String saveFile) |
static void |
setThreadPool(PoolManager.Pool pool)
设置线程池
|
protected DownloadHttpClient(String group, boolean safe)
public static DownloadHttpClient build(String group)
group
- public static DownloadHttpClient build(String group, boolean safe)
group
- safe
- public static void setThreadPool(PoolManager.Pool pool)
pool
- protected DownloadRetryHandler getDownloadRetryHandler()
public Future send(Object tag, String url, DownloadResponseHandler responseHandler, long from, String saveFile)
tag
- url
- responseHandler
- from
- saveFile
- protected Future sendRequest(Request urlRequest, DownloadResponseHandler responseHandler, String saveFile)
public void cancelRequests(Object tag, boolean mayInterruptIfRunning)
tag
- mayInterruptIfRunning
- public void cancelAll()
public void close()