开发者社区> 问答> 正文

Multipart Upload 操作



初始化 Multipart Upload 任务



请求参数(InitiateMultipartUploadRequest

变量名类型描述
vaultIdString待新建任务的Vault的ID
partSizelong分块的字节大小
descriptionStringArchive的描述字段


接口定义/**
* 初始化Multipart上传任务同步接口
* @param initiateMultipartUploadRequest 初始化Multipart上传任务请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public InitiateMultipartUploadResult initiateMultipartUpload(
    InitiateMultipartUploadRequest initiateMultipartUploadRequest)
    throws OASClientException, OASServerException;

/**
* 初始化Multipart上传任务异步接口
* @param initiateMultipartUploadRequest 初始化Multipart上传任务请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> initiateMultipartUploadAsync(
    InitiateMultipartUploadRequest initiateMultipartUploadRequest,
    AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果(InitiateMultipartUploadResult

变量名类型描述
locationString成功新建的任务的URI
uploadIdString成功新建的任务的ID


获取 Multipart Upload任务列表



请求参数(ListMultipartUploadsRequest

变量名类型描述
vaultIdString待查询的Vault的ID
limitint返回列表的最大长度
markerString列表的起始标识


接口定义/**
* 获取Multipart上传任务列表同步接口
* @param listMultipartUploadsRequest 获取Multipart上传任务列表请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public ListMultipartUploadsResult listMultipartUploads(
    ListMultipartUploadsRequest listMultipartUploadsRequest)
    throws OASClientException, OASServerException;

/**
* 获取Multipart上传任务列表异步接口
* @param listMultipartUploadsRequest 获取Multipart上传任务列表请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> listMultipartUploadsAsync(
    ListMultipartUploadsRequest listMultipartUploadsRequest,
    AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果(ListMultipartUploadsResult

变量名类型描述
markerString下一次列表查询的起始标识
uploadListList<MultipartUploadDescriptor>Mulitpart Upload的JSON描述列表


删除 Multipart Upload 任务



请求参数(CancelMultipartUploadRequest

变量名类型描述
vaultIdString待删除的任务所属Vault的ID。
uploadIdString待删除的任务的ID。


接口定义/**
* 删除Multipart上传任务同步接口
* @param cancelMultipartUploadRequest 删除Multipart上传任务请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public OASResult cancelMultipartUpload(
    CancelMultipartUploadRequest cancelMultipartUploadRequest)
    throws OASClientException, OASServerException;

/**
* 删除Multipart上传任务异步接口
* @param cancelMultipartUploadRequest 删除Multipart上传任务请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> cancelMultipartUploadAsync(
    CancelMultipartUploadRequest cancelMultipartUploadRequest,
    AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果(OASResult



Part上传



请求参数(UploadPartRequest

变量名类型描述
vaultIdString待上传的任务所属Vault的ID
uploadIdString待上传的Part所属任务的ID
fileFile待上传的文件,与stream为二选一参数,两者均设置时结果不确定
streamInputStream待上传的流,与file为二选一参数,两者均设置时结果不确定
rangeRange待上传的Part对应整个文件的字节范围
contentEtagString校验字段
treeEtagString哈希树校验信息


接口定义/**
* 上传Part同步接口
* @param uploadPartRequest 上传Part请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public OASResult uploadPart(UploadPartRequest uploadPartRequest)
    throws OASClientException, OASServerException;

/**
* 上传Part异步接口
* @param uploadPartRequest 上传Part请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> uploadPartAsync(
    UploadPartRequest uploadPartRequest, AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果(OASResult


参考OASResult结构

获取 Part 列表



请求参数(ListPartsRequest

变量名类型描述
vaultIdString待查询的任务所属Vault的ID
uploadIdString待查询的任务的ID
limitint返回列表的最大长度
markerString列表的起始标识


接口定义/**
* 获取Part列表同步接口
* @param listPartsRequest 获取Part列表请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public ListPartsResult listParts(ListPartsRequest listPartsRequest)
    throws OASClientException, OASServerException;

/**
* 获取Part列表异步接口
* @param listPartsRequest 获取Part列表请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> listPartsAsync(
    ListPartsRequest listPartsRequest, AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果(ListPartsResult

变量名类型描述
markerString下一次列表查询的起始标识
descriptorMultipartUploadDescriptorMulitpart Upload任务的JSON描述


Part 合并



请求参数(CompleteMultipartUploadRequest

变量名类型描述
vaultIdString待合并的任务所属Vault的ID
uploadIdString待合并的任务的ID
sizelong文件的字节大小
treeEtagString哈希树校验字段


接口定义/**
* Part合并同步接口
* @param completeMultipartUploadRequest Part合并请求对象
* @return
* @throws OASClientException
* @throws OASServerException
*/
public CompleteMultipartUploadResult completeMultipartUpload(
    CompleteMultipartUploadRequest completeMultipartUploadRequest)
    throws OASClientException, OASServerException;

/**
* Part合并异步接口
* @param completeMultipartUploadRequest Part合并请求对象
* @param handler 异步请求处理器
* @return
* @throws OASClientException
* @throws OASServerException
*/
public <T> ListenableFuture<T> completeMultipartUploadAsync(
    CompleteMultipartUploadRequest completeMultipartUploadRequest,
    AsyncHandler<T> handler)
    throws OASClientException, OASServerException;





响应结果

变量名类型描述
[tr=rgb(239, 251, 255)][td]location String成功上传的Archive的URI archiveIdString成功上传的Archive的ID

展开
收起
云栖大讲堂 2017-10-26 15:10:14 2440 0
0 条回答
写回答
取消 提交回答
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Architecting a Multi-Tenanted 立即下载
Architecting a Multi-Tenanted Platform 立即下载
Multi-label Graaph Analysis an 立即下载