public final class UploadPartRequest extends BaseMultipartUploadRequest
CosXmlRequest.OnRequestWeightListener
cosPath
bucket, noSignHeaders, noSignParams, priority, qCloudTaskStateListener, queryParameters, region, requestHeaders, requestURL, signSourceProvider
构造器和说明 |
---|
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
byte[] data,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.io.InputStream inputStream,
long size,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.io.InputStream inputStream,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.lang.String srcPath,
long offset,
long length,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.lang.String srcPath,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
android.net.Uri uri,
long offset,
long length,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
android.net.Uri uri,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.net.URL url,
long offset,
long length,
java.lang.String uploadId) |
UploadPartRequest(java.lang.String bucket,
java.lang.String cosPath,
int partNumber,
java.net.URL url,
java.lang.String uploadId) |
限定符和类型 | 方法和说明 |
---|---|
void |
checkParameters()
sdk 参数校验
|
byte[] |
getData()
获取用户设置的字节数组
|
long |
getFileContentLength() |
long |
getFileLength()
获取用户设置的输入流读取的字节长度
|
long |
getFileOffset() |
java.lang.String |
getMethod()
获取HTTP请求方法
RequestMethod |
int |
getPartNumber()
获取用户设置的上传分块编号
|
CosXmlProgressListener |
getProgressListener() |
java.util.Map<java.lang.String,java.lang.String> |
getQueryString()
获取url query集合
|
java.lang.String |
getSrcPath()
获取设置的本地文件路径
|
java.lang.String |
getUploadId()
获取用户设置分块上传的UploadId号
|
android.net.Uri |
getUri() |
boolean |
isLastPart() |
boolean |
isPriorityLow() |
void |
setData(byte[] data)
设置上传的字节数组
可以设置上传本地文件、字节数组或者输入流。
|
void |
setFileContentLength(long fileContentLength) |
void |
setFileOffset(long fileOffset) |
void |
setInputStream(java.io.InputStream inputStream) |
void |
setLastPart(boolean lastPart) |
void |
setPartNumber(int partNumber)
设置上传的分块编号
|
void |
setPriorityLow() |
void |
setProgressListener(CosXmlProgressListener progressListener)
设置上传进度回调
|
void |
setSrcPath(java.lang.String srcPath)
设置上传的本地文件路径
可以设置上传本地文件、字节数组或者输入流。
|
void |
setSrcPath(java.lang.String srcPath,
long fileOffset,
long contentLength)
设置上传的本地文件路径和上传范围
|
void |
setTrafficLimit(long limit)
单链接限速,单位为bit/s
限速值设置范围为819200~838860800,即100KB/s~100MB/s,如果超出该范围会返回400错误。
|
void |
setUploadId(java.lang.String uploadId)
设置分块上传的UploadId
|
protected RequestBodySerializer |
xmlBuilder()
收拢xml解析
|
getSTSCredentialScope
getContentType, getCosPath, getPath, setCosPath, setCOSServerSideEncryption, setCOSServerSideEncryptionWithCustomerKey, setCOSServerSideEncryptionWithKMS
addHeader, addNoSignHeader, addNoSignParams, addQuery, attachMetrics, getBucket, getHttpTask, getKeyTime, getMetrics, getNoSignHeaders, getNoSignParams, getPriority, getQueryEncodedString, getRegion, getRequestBody, getRequestHeaders, getRequestHost, getRequestURL, getSignSourceProvider, getWeight, headersHasUnsafeNonAscii, isNeedMD5, isSignInUrl, isSupportAccelerate, isSupportAccelerate, setNeedMD5, setOnRequestWeightListener, setQueryEncodedString, setQueryParameters, setRegion, setRequestHeaders, setRequestHeaders, setRequestHeaders, setRequestURL, setSign, setSign, setSign, setSign, setSign, setSignInUrl, setSignKeyTime, setSignParamsAndHeaders, setSignSourceProvider, setTask, setTaskStateListener
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.lang.String srcPath, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, android.net.Uri uri, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.lang.String srcPath, long offset, long length, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, android.net.Uri uri, long offset, long length, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, byte[] data, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.io.InputStream inputStream, java.lang.String uploadId) throws CosXmlClientException
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.io.InputStream inputStream, long size, java.lang.String uploadId) throws CosXmlClientException
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.net.URL url, java.lang.String uploadId)
public UploadPartRequest(java.lang.String bucket, java.lang.String cosPath, int partNumber, java.net.URL url, long offset, long length, java.lang.String uploadId)
public void setPartNumber(int partNumber)
partNumber
- 上传的分块数public int getPartNumber()
public void setUploadId(java.lang.String uploadId)
uploadId
- 分块上传的UploadIdpublic java.lang.String getUploadId()
public long getFileOffset()
public long getFileContentLength()
public void setInputStream(java.io.InputStream inputStream)
public void setFileOffset(long fileOffset)
public void setFileContentLength(long fileContentLength)
public boolean isLastPart()
public void setLastPart(boolean lastPart)
public java.lang.String getMethod()
CosXmlRequest
RequestMethod
getMethod
在类中 CosXmlRequest
public java.util.Map<java.lang.String,java.lang.String> getQueryString()
CosXmlRequest
getQueryString
在类中 CosXmlRequest
protected RequestBodySerializer xmlBuilder() throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
CosXmlRequest
xmlBuilder
在类中 CosXmlRequest
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public void checkParameters() throws CosXmlClientException
CosXmlRequest
checkParameters
在类中 ObjectRequest
CosXmlClientException
- cosXmlClientExceptionpublic void setPriorityLow()
public boolean isPriorityLow()
public void setSrcPath(java.lang.String srcPath)
设置上传的本地文件路径
可以设置上传本地文件、字节数组或者输入流。每次只能上传一种类型,若同时设置, 则优先级为 本地文件>字节数组>输入流srcPath
- 本地文件路径public void setSrcPath(java.lang.String srcPath, long fileOffset, long contentLength)
setSrcPath(String)
public java.lang.String getSrcPath()
public android.net.Uri getUri()
public void setData(byte[] data)
设置上传的字节数组
可以设置上传本地文件、字节数组或者输入流。每次只能上传一种类型,若同时设置, 则优先级为 本地文件>字节数组>输入流data
- 需要上传的字节数组public byte[] getData()
public long getFileLength()
public void setProgressListener(CosXmlProgressListener progressListener)
progressListener
- CosXmlProgressListener
public CosXmlProgressListener getProgressListener()
public void setTrafficLimit(long limit)