public class UploadClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static UploadClient |
INSTANCE |
| Constructor and Description |
|---|
UploadClient() |
| Modifier and Type | Method and Description |
|---|---|
ApiClient |
getApiClient() |
void |
setMulitUploadExecutor(ThreadPoolExecutor mulitUploadExecutor)
允许用户自定义分片上传线程池
|
void |
setSimpleUploadExecutor(ThreadPoolExecutor simpleUploadExecutor)
允许用户自定义简单上传线程池
|
<R> R |
uploadFile(String path,
Map<String,Object> formParams,
File file,
com.baidu.dev2.thirdparty.jackson.databind.node.ObjectNode paramsJson,
String fileKey,
Integer multipartThreshold,
Integer partSize,
Integer partParallel,
Integer timeout,
com.baidu.dev2.thirdparty.jackson.core.type.TypeReference<R> returnType)
文件上传
|
public static final UploadClient INSTANCE
public ApiClient getApiClient()
public void setSimpleUploadExecutor(ThreadPoolExecutor simpleUploadExecutor)
simpleUploadExecutor - public void setMulitUploadExecutor(ThreadPoolExecutor mulitUploadExecutor)
mulitUploadExecutor - public <R> R uploadFile(String path, Map<String,Object> formParams, File file, com.baidu.dev2.thirdparty.jackson.databind.node.ObjectNode paramsJson, String fileKey, Integer multipartThreshold, Integer partSize, Integer partParallel, Integer timeout, com.baidu.dev2.thirdparty.jackson.core.type.TypeReference<R> returnType) throws ApiException
R - path - 上传请求路径formParams - 表单参数file - 文件paramsJson - params参数jsonfileKey - 文件参数名:不填默认:"file"multipartThreshold - 分片上传阈值:不填默认:100MpartSize - 分片大小:不填默认:5MpartParallel - 分片上传并发数:不填默认:5timeout - 上传超时时间(ms):不填默认为0 永不超时returnType - 返回ApiExceptionCopyright © 2023. All rights reserved.