public class OkAsyncDownload extends BaseOkRequest implements Asyncable<Consumer<OkResponse>>
call, client, request, tag
body, bodyLen, bodyOffset, charset, contentType, cookies, DEFAULT_USERAGENT, formParts, headers, ignoreHeaders, method, queryParams, queryString, queryStringEncode, url
Constructor and Description |
---|
OkAsyncDownload(String url) |
OkAsyncDownload(String url,
okhttp3.OkHttpClient client) |
Modifier and Type | Method and Description |
---|---|
void |
async(Consumer<OkResponse> callback)
异步执行
|
OkAsyncDownload |
asyncFailThrows() |
OkAsyncDownload |
asyncFailThrows(boolean asyncFailThrows) |
OkAsyncDownload |
download(File file)
下载文件
|
OkAsyncDownload |
download(OutputStream out)
下载文件
|
OkAsyncDownload |
download(OutputStream out,
boolean autoClose)
下载文件
|
OkAsyncDownload |
download(String file)
下载文件
|
buildRequest, cancel, client, getCall, getClient, getRequest, getRequestMessage, getTag, setBody, setMultipartBody, tag
body, body, body, charset, contentType, contentType, cookie, cookies, format, format, formPart, formParts, getBody, getBodyLen, getBodyOffset, getCharset, getContentType, getCookies, getFormParts, getHeaders, getIgnoreHeaders, getMethod, getQueryParams, getQueryString, getUrl, header, headers, ignoreHeader, ignoreHeaders, ignoreHeaders, isNoBodyRequest, isQueryStringEncode, method, method, queryParam, queryParams, queryStringEncode, referer, toString, url, userAgent
public OkAsyncDownload(String url)
public OkAsyncDownload(String url, okhttp3.OkHttpClient client)
public OkAsyncDownload asyncFailThrows(boolean asyncFailThrows)
public OkAsyncDownload asyncFailThrows()
public OkAsyncDownload download(String file)
file
- 文件存放路径public OkAsyncDownload download(File file)
file
- 文件存放路径public OkAsyncDownload download(OutputStream out)
out
- 输出流public OkAsyncDownload download(OutputStream out, boolean autoClose)
out
- 输出流autoClose
- 是否自动关闭public void async(Consumer<OkResponse> callback)
Asyncable
async
in interface Asyncable<Consumer<OkResponse>>
callback
- 异步处理器Copyright © 2024. All rights reserved.