public class PostObjectRequest extends ObjectRequest
限定符和类型 | 类和说明 |
---|---|
static class |
PostObjectRequest.Policy
策略
详情请参考:POST Object中的 构造“策略”(Policy)
|
CosXmlRequest.OnRequestWeightListener
cosPath
bucket, noSignHeaders, noSignParams, priority, qCloudTaskStateListener, queryParameters, region, requestHeaders, requestURL, signSourceProvider
构造器和说明 |
---|
PostObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
byte[] data) |
PostObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.io.InputStream inputStream) |
PostObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
java.lang.String srcPath) |
限定符和类型 | 方法和说明 |
---|---|
void |
checkParameters()
sdk 参数校验
|
java.lang.String |
getMethod()
获取HTTP请求方法
RequestMethod |
CosXmlProgressListener |
getProgressListener()
获取上传进度回调监听
|
RequestBodySerializer |
getRequestBody()
获取请求体
|
QCloudSignSourceProvider |
getSignSourceProvider()
获取签名原料提供器
|
void |
setAcl(java.lang.String acl)
定义对象的访问控制列表(ACL)属性。
|
void |
setCacheControl(java.lang.String cacheControl)
设置Cache-Control头部
|
void |
setContentDisposition(java.lang.String contentDisposition)
设置Content-Disposition头部
|
void |
setContentEncoding(java.lang.String contentEncoding)
设置Content-Encoding头部
|
void |
setContentType(java.lang.String contentType)
设置Content-Type头部
|
void |
setCosStorageClass(java.lang.String cosStorageClass)
设置对象的存储类型。
|
void |
setCustomerHeader(java.lang.String key,
java.lang.String value)
设置from表单内容
|
void |
setExpires(java.lang.String expires)
设置Expires头部
|
void |
setHeader(java.lang.String key,
java.lang.String value)
设置HTTP头部
|
void |
setPolicy(PostObjectRequest.Policy policy)
设置策略
|
void |
setProgressListener(CosXmlProgressListener progressListener)
设置上传进度回调监听
|
void |
setRange(long offset,
long contentSize)
设置文件长度范围
|
void |
setSignParamsAndHeaders(java.util.Set<java.lang.String> parameters,
java.util.Set<java.lang.String> headers)
设置参与签名的参数字段和头部字段
|
void |
setStroageClass(COSStorageClass stroageClass)
设置对象的存储类型。
|
void |
setSuccessActionRedirect(java.lang.String redirectHost)
设置上传成功时重定向的目标 URL 地址
|
void |
setSuccessActionStatus(int successHttpCode)
设置上传成功时返回的 HTTP 状态码
|
void |
setTrafficLimit(long limit)
单链接限速,单位为bit/s
限速值设置范围为819200~838860800,即100KB/s~100MB/s,如果超出该范围会返回400错误。
|
getContentType, getCosPath, getPath, setCosPath, setCOSServerSideEncryption, setCOSServerSideEncryptionWithCustomerKey, setCOSServerSideEncryptionWithKMS
addHeader, addNoSignHeader, addNoSignParams, addQuery, attachMetrics, getBucket, getHttpTask, getKeyTime, getMetrics, getNoSignHeaders, getNoSignParams, getPriority, getQueryEncodedString, getQueryString, getRegion, getRequestHeaders, getRequestHost, getRequestURL, getSTSCredentialScope, getWeight, headersHasUnsafeNonAscii, isNeedMD5, isSignInUrl, isSupportAccelerate, isSupportAccelerate, setNeedMD5, setOnRequestWeightListener, setQueryEncodedString, setQueryParameters, setRegion, setRequestHeaders, setRequestHeaders, setRequestHeaders, setRequestURL, setSign, setSign, setSign, setSign, setSign, setSignInUrl, setSignKeyTime, setSignSourceProvider, setTask, setTaskStateListener, xmlBuilder
public PostObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.lang.String srcPath)
public PostObjectRequest(java.lang.String bucket, java.lang.String cosPath, byte[] data)
public PostObjectRequest(java.lang.String bucket, java.lang.String cosPath, java.io.InputStream inputStream)
public void setRange(long offset, long contentSize)
public java.lang.String getMethod()
CosXmlRequest
RequestMethod
getMethod
在类中 CosXmlRequest
public RequestBodySerializer getRequestBody() throws CosXmlClientException
CosXmlRequest
getRequestBody
在类中 CosXmlRequest
CosXmlClientException
- 客户异常public void setSignParamsAndHeaders(java.util.Set<java.lang.String> parameters, java.util.Set<java.lang.String> headers)
CosXmlRequest
setSignParamsAndHeaders
在类中 CosXmlRequest
parameters
- 参与签名的参数字段headers
- 参与签名的头部字段public QCloudSignSourceProvider getSignSourceProvider()
CosXmlRequest
getSignSourceProvider
在类中 CosXmlRequest
public void checkParameters() throws CosXmlClientException
CosXmlRequest
checkParameters
在类中 ObjectRequest
CosXmlClientException
- cosXmlClientExceptionpublic void setProgressListener(CosXmlProgressListener progressListener)
progressListener
- 进度监听器 CosXmlProgressListener
public CosXmlProgressListener getProgressListener()
public void setAcl(java.lang.String acl)
acl
- COS 访问权限public void setCacheControl(java.lang.String cacheControl)
设置Cache-Control头部
cacheControl
- Cache-Control头部public void setContentType(java.lang.String contentType)
设置Content-Type头部
contentType
- Content-Type头部public void setContentDisposition(java.lang.String contentDisposition)
设置Content-Disposition头部
contentDisposition
- Content-Disposition头部public void setContentEncoding(java.lang.String contentEncoding)
设置Content-Encoding头部
contentEncoding
- Content-Encoding头部public void setExpires(java.lang.String expires)
设置Expires头部
expires
- Expires头部public void setStroageClass(COSStorageClass stroageClass)
stroageClass
- COS存储类型public void setHeader(java.lang.String key, java.lang.String value)
key
- 键value
- 值public void setCustomerHeader(java.lang.String key, java.lang.String value)
key
- 键value
- 值public void setCosStorageClass(java.lang.String cosStorageClass)
cosStorageClass
- COS存储类型public void setSuccessActionRedirect(java.lang.String redirectHost)
redirectHost
- 上传成功时重定向的目标 URL 地址public void setSuccessActionStatus(int successHttpCode)
successHttpCode
- 上传成功时返回的 HTTP 状态码public void setPolicy(PostObjectRequest.Policy policy)
policy
- 策略public void setTrafficLimit(long limit)