public class TransferManager
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
protected CosXmlSimpleService |
cosXmlService |
protected TransferConfig |
transferConfig |
构造器和说明 |
---|
TransferManager(CosXmlSimpleService cosXmlService,
TransferConfig transferConfig)
TransferManager 构造器,
|
限定符和类型 | 方法和说明 |
---|---|
COSXMLCopyTask |
copy(CopyObjectRequest copyObjectRequest)
通过初始化
CopyObjectRequest 来复制文件 |
COSXMLCopyTask |
copy(CopyObjectRequest copyObjectRequest,
java.lang.String uploadId) |
COSXMLCopyTask |
copy(java.lang.String bucket,
java.lang.String cosPath,
CopyObjectRequest.CopySourceStruct copySourceStruct)
复制文件
|
COSXMLCopyTask |
copy(java.lang.String bucket,
java.lang.String cosPath,
CopyObjectRequest.CopySourceStruct copySourceStruct,
COSXMLTask.OnSignatureListener onSignatureListener)
复制文件,并自行负责签名串的生成
|
COSXMLDownloadTask |
download(android.content.Context context,
GetObjectRequest getObjectRequest)
通过初始化
GetObjectRequest 请求来下载文件 |
COSXMLDownloadTask |
download(android.content.Context context,
java.lang.String bucket,
java.lang.String cosPath,
java.lang.String savedDirPath)
下载文件
|
COSXMLDownloadTask |
download(android.content.Context context,
java.lang.String bucket,
java.lang.String cosPath,
java.lang.String savedDirPath,
java.lang.String savedFileName)
指定下载到本地的文件名来下载文件
|
COSXMLDownloadTask |
download(android.content.Context context,
java.lang.String bucket,
java.lang.String cosPath,
java.lang.String savedDirPath,
java.lang.String savedFileName,
COSXMLTask.OnSignatureListener onSignatureListener)
下载文件,并自行负责签名串的生成
|
CosXmlSimpleService |
getCosXmlService()
获取对应的
CosXmlSimpleService 对象 |
COSXMLUploadTask |
upload(PutObjectRequest putObjectRequest,
java.lang.String uploadId)
通过初始化
PutObjectRequest 来上传文件
支持给 pubObjectRequest 设置 Header,后续所有的上传相关的请求都会带上对应的 Header |
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
byte[] bytes)
上传字节数组到 COS,仅仅支持简单上传
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
java.io.InputStream inputStream)
通过流上传到 COS,仅仅支持简单上传。
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
java.lang.String srcPath,
java.lang.String uploadId)
通过本地文件绝对路径来上传文件
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
java.lang.String srcPath,
java.lang.String uploadId,
COSXMLTask.OnSignatureListener onSignatureListener)
通过本地文件绝对路径上传文件,并自行负责签名串的生成
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
android.net.Uri uri,
java.lang.String uploadId)
通过本地文件 Uri 路径来上传文件
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
java.net.URL url,
java.lang.String uploadId)
通过远程 URL 来上传文件
|
COSXMLUploadTask |
upload(java.lang.String bucket,
java.lang.String cosPath,
java.net.URL url,
UrlUploadPolicy urlUploadPolicy,
java.lang.String uploadId)
通过远程 URL 来上传文件
|
protected CosXmlSimpleService cosXmlService
protected TransferConfig transferConfig
public TransferManager(CosXmlSimpleService cosXmlService, TransferConfig transferConfig)
cosXmlService
- CosXmlSimpleService 对象,用于真正发起传输请求transferConfig
- 传输配置类public COSXMLUploadTask upload(PutObjectRequest putObjectRequest, java.lang.String uploadId)
PutObjectRequest
来上传文件
支持给 pubObjectRequest 设置 Header,后续所有的上传相关的请求都会带上对应的 Header
putObjectRequest
- 上传请求Request封装类uploadId
- 是否分片续传的uploadIdpublic COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, java.lang.String srcPath, java.lang.String uploadId)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置srcPath
- 文件本地路径uploadId
- 是否分片续传的uploadId,如果为空,则从头开始上传文件public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, android.net.Uri uri, java.lang.String uploadId)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置uri
- 文件本地 Uri 路径uploadId
- 是否分片续传的uploadId,如果为空,则从头开始上传文件public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, java.net.URL url, java.lang.String uploadId)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置url
- 远程 URLuploadId
- 是否分片续传的uploadId,如果为空,则从头开始上传文件public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, java.net.URL url, UrlUploadPolicy urlUploadPolicy, java.lang.String uploadId)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置url
- 远程 URLurlUploadPolicy
- url上传策略uploadId
- 是否分片续传的uploadId,如果为空,则从头开始上传文件public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, byte[] bytes)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置bytes
- 字节数组public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, java.io.InputStream inputStream)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置inputStream
- 输入流public COSXMLUploadTask upload(java.lang.String bucket, java.lang.String cosPath, java.lang.String srcPath, java.lang.String uploadId, COSXMLTask.OnSignatureListener onSignatureListener)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置srcPath
- 文件本地路径uploadId
- 是否分片续传的uploadIdonSignatureListener
- 签名注册器public COSXMLDownloadTask download(android.content.Context context, java.lang.String bucket, java.lang.String cosPath, java.lang.String savedDirPath)
context
- app上下文bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置savedDirPath
- 文件下载到本地的路径public COSXMLDownloadTask download(android.content.Context context, java.lang.String bucket, java.lang.String cosPath, java.lang.String savedDirPath, java.lang.String savedFileName)
context
- app上下文bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置savedDirPath
- 文件下载到本地的路径savedFileName
- 文件下载本地的别名public COSXMLDownloadTask download(android.content.Context context, GetObjectRequest getObjectRequest)
GetObjectRequest
请求来下载文件context
- app上下文getObjectRequest
- 下载请求Request封装类public COSXMLDownloadTask download(android.content.Context context, java.lang.String bucket, java.lang.String cosPath, java.lang.String savedDirPath, java.lang.String savedFileName, COSXMLTask.OnSignatureListener onSignatureListener)
context
- app上下文bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置savedDirPath
- 文件下载到本地的路径savedFileName
- 文件下载本地的别名onSignatureListener
- 签名注册器public COSXMLCopyTask copy(java.lang.String bucket, java.lang.String cosPath, CopyObjectRequest.CopySourceStruct copySourceStruct)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置copySourceStruct
- 源文件存储于COS的位置public COSXMLCopyTask copy(CopyObjectRequest copyObjectRequest)
CopyObjectRequest
来复制文件copyObjectRequest
- 复制请求Request封装类public COSXMLCopyTask copy(CopyObjectRequest copyObjectRequest, java.lang.String uploadId)
public COSXMLCopyTask copy(java.lang.String bucket, java.lang.String cosPath, CopyObjectRequest.CopySourceStruct copySourceStruct, COSXMLTask.OnSignatureListener onSignatureListener)
bucket
- 存储桶cosPath
- 文件存放于存储桶上的位置copySourceStruct
- 源文件存储于COS的位置public CosXmlSimpleService getCosXmlService()
CosXmlSimpleService
对象CosXmlSimpleService
对象