public class BasePutObjectRequest extends UploadRequest
CosXmlRequest.OnRequestWeightListener
限定符和类型 | 字段和说明 |
---|---|
protected byte[] |
data |
protected long |
fileLength |
protected java.io.InputStream |
inputStream |
protected CosXmlProgressListener |
progressListener |
protected java.lang.String |
srcPath |
protected java.lang.String |
strData |
protected android.net.Uri |
uri |
protected java.net.URL |
url |
protected UrlUploadPolicy |
urlUploadPolicy |
cosPath
bucket, noSignHeaders, noSignParams, priority, qCloudTaskStateListener, queryParameters, region, requestHeaders, requestURL, signSourceProvider
限定符 | 构造器和说明 |
---|---|
protected |
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath) |
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
byte[] data)
PutObject 构造方法
|
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.io.InputStream inputStream)
PutObject 构造方法
|
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.lang.String srcPath)
PutObject 构造方法
|
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.lang.StringBuilder stringBuilder)
PutObject 构造方法
|
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
android.net.Uri uri) |
|
BasePutObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.net.URL url)
PutObject 构造方法
|
限定符和类型 | 方法和说明 |
---|---|
void |
checkParameters()
sdk 参数校验
|
byte[] |
getData()
获取用户设置的字节数组
|
long |
getFileLength()
获取待上传数据的总长度
|
java.io.InputStream |
getInputStream() |
java.lang.String |
getMethod()
获取HTTP请求方法
RequestMethod |
CosXmlProgressListener |
getProgressListener() |
java.lang.String |
getSrcPath()
获取设置的本地文件路径
|
java.lang.String |
getStrData() |
android.net.Uri |
getUri() |
java.net.URL |
getUrl() |
UrlUploadPolicy |
getUrlUploadPolicy() |
boolean |
isPriorityLow() |
void |
setData(byte[] data)
设置上传的字节数组.
|
void |
setInputStream(java.io.InputStream inputStream) |
void |
setPriorityLow() |
void |
setProgressListener(CosXmlProgressListener progressListener)
上传进度回调
|
void |
setSrcPath(java.lang.String srcPath)
设置上传的本地文件路径.
|
void |
setStrData(java.lang.String strData) |
void |
setTrafficLimit(long limit)
单链接限速,单位为bit/s
限速值设置范围为819200~838860800,即100KB/s~100MB/s,如果超出该范围会返回400错误。
|
void |
setUri(android.net.Uri uri) |
void |
setUrl(java.net.URL url) |
void |
setUrlUploadPolicy(UrlUploadPolicy urlUploadPolicy)
设置URL上传策略
|
protected RequestBodySerializer |
xmlBuilder()
收拢xml解析
|
getContentType, getCosPath, getPath, setCosPath, setCOSServerSideEncryption, setCOSServerSideEncryptionWithCustomerKey, setCOSServerSideEncryptionWithKMS
addHeader, addNoSignHeader, addNoSignParams, addQuery, attachMetrics, getBucket, getHttpTask, getKeyTime, getMetrics, getNoSignHeaders, getNoSignParams, getPriority, getQueryEncodedString, getQueryString, getRegion, getRequestBody, getRequestHeaders, getRequestHost, getRequestURL, getSignSourceProvider, getSTSCredentialScope, 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
protected java.lang.String srcPath
protected byte[] data
protected java.io.InputStream inputStream
protected java.lang.String strData
protected java.net.URL url
protected UrlUploadPolicy urlUploadPolicy
protected long fileLength
protected android.net.Uri uri
protected CosXmlProgressListener progressListener
protected BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath)
public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.lang.String srcPath)
bucket
- 存储桶名称(cos v5 的 bucket格式为:xxx-appid, 如 bucket-1250000000)cosPath
- 远端路径,即存储到 COS 上的绝对路径srcPath
- 本地文件的绝对路径public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, android.net.Uri uri)
public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, byte[] data)
bucket
- 存储桶名称(cos v5 的 bucket格式为:xxx-appid, 如 bucket-1250000000)cosPath
- 远端路径,即存储到 COS 上的绝对路径data
- 上传的数据public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.lang.StringBuilder stringBuilder)
bucket
- 存储桶名称cosPath
- 远端路径,即存储到 COS 上的绝对路径stringBuilder
- 上传的字符串public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.io.InputStream inputStream)
bucket
- 存储桶名称(cos v5 的 bucket格式为:xxx-appid, 如 bucket-1250000000)cosPath
- 远端路径,即存储到 COS 上的绝对路径inputStream
- 上传的数据流public BasePutObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.net.URL url)
bucket
- 存储桶名称(cos v5 的 bucket格式为:xxx-appid, 如 bucket-1250000000)cosPath
- 远端路径,即存储到 COS 上的绝对路径url
- 上传的urlpublic java.lang.String getMethod()
CosXmlRequest
RequestMethod
getMethod
在类中 CosXmlRequest
public void setPriorityLow()
public boolean isPriorityLow()
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 setProgressListener(CosXmlProgressListener progressListener)
progressListener
- 进度监听器 CosXmlProgressListener
public CosXmlProgressListener getProgressListener()
public void setSrcPath(java.lang.String srcPath)
设置上传的本地文件路径.
可以设置上传本地文件、字节数组或者输入流。每次只能上传一种类型,若同时设置,
则优先级为 本地文件>字节数组>输入流
srcPath
- 本地文件路径public java.lang.String getSrcPath()
public void setData(byte[] data)
设置上传的字节数组.
可以设置上传本地文件、字节数组或者输入流。每次只能上传一种类型,若同时设置,
则优先级为 本地文件>字节数组>输入流
data
- 需要上传的字节数组public void setStrData(java.lang.String strData)
public java.lang.String getStrData()
public java.net.URL getUrl()
public UrlUploadPolicy getUrlUploadPolicy()
public void setUrl(java.net.URL url)
public void setUri(android.net.Uri uri)
public android.net.Uri getUri()
public java.io.InputStream getInputStream()
public void setInputStream(java.io.InputStream inputStream)
public byte[] getData()
public long getFileLength()
public void setTrafficLimit(long limit)
public void setUrlUploadPolicy(UrlUploadPolicy urlUploadPolicy)
urlUploadPolicy
- url上传策略