public class CopyObjectRequest extends ObjectRequest
限定符和类型 | 类和说明 |
---|---|
static class |
CopyObjectRequest.CopySourceStruct
复制源结构体
|
CosXmlRequest.OnRequestWeightListener
cosPath
bucket, noSignHeaders, noSignParams, priority, qCloudTaskStateListener, queryParameters, region, requestHeaders, requestURL, signSourceProvider
构造器和说明 |
---|
CopyObjectRequest(java.lang.String bucket,
java.lang.String cosPath,
CopyObjectRequest.CopySourceStruct copySourceStruct) |
限定符和类型 | 方法和说明 |
---|---|
void |
checkParameters()
sdk 参数校验
|
CopyObjectRequest.CopySourceStruct |
getCopySource()
获取源对象结构体
|
java.lang.String |
getCosPath()
获取复制的目标cos路径
|
java.lang.String |
getMethod()
获取HTTP请求方法
RequestMethod |
RequestBodySerializer |
getRequestBody()
获取请求体
|
STSCredentialScope[] |
getSTSCredentialScope(CosXmlServiceConfig config)
获取STS范围限制信息
|
void |
setCopyIfMatch(java.lang.String eTag)
当对象的 ETag 与指定的值一致,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed)
|
void |
setCopyIfModifiedSince(java.lang.String sourceIfModifiedSince)
当对象在指定时间后被修改,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed)
|
void |
setCopyIfNoneMatch(java.lang.String eTag)
当对象的 ETag 与指定的值不一致,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed)
|
void |
setCopyIfUnmodifiedSince(java.lang.String sourceIfUnmodifiedSince)
当对象在指定时间后未被修改,则执行复制操作,否则返回 HTTP 状态码为412(Precondition Failed)
|
void |
setCopyMetaDataDirective(MetaDataDirective metaDataDirective)
是否复制源对象的元数据信息,枚举值:Copy,Replaced,默认为 Copy:
如果标记为 Copy,则复制源对象的元数据信息
如果标记为 Replaced,则按本次请求的请求头中的元数据信息作为目标对象的元数据信息
当目标对象和源对象为同一对象时,即用户试图修改元数据时,则标记必须为 Replaced
|
void |
setCopySource(CopyObjectRequest.CopySourceStruct copySource,
CosXmlServiceConfig config)
设置复制源对象信息
|
void |
setCopySourceServerSideEncryptionCustomerKey(java.lang.String sourceKey)
源对象SSE-C服务端加密配置
|
void |
setCopySourceServerSideEncryptionKMS(java.lang.String customerKeyID,
java.lang.String json)
源对象SSE-KMS服务端加密配置
|
void |
setCosPath(java.lang.String cosPath)
设置复制的目标cos路径
|
void |
setCosStorageClass(COSStorageClass cosStorageClass)
目标对象的存储类型。
|
void |
setXCOSACL(COSACL cosacl)
定义目标对象的访问控制列表(ACL)属性。
|
void |
setXCOSACL(java.lang.String cosacl)
|
void |
setXCOSGrantRead(ACLAccount aclAccount)
赋予被授权者操作目标对象的读取权限
|
void |
setXCOSGrantWrite(ACLAccount aclAccount)
赋予被授权者操作目标对象的写入权限
|
void |
setXCOSMeta(java.lang.String key,
java.lang.String value)
设置用户自定义头部信息
|
void |
setXCOSReadWrite(ACLAccount aclAccount)
赋予被授权者操作目标对象的所有权限
|
getContentType, getPath, setCOSServerSideEncryption, setCOSServerSideEncryptionWithCustomerKey, setCOSServerSideEncryptionWithKMS
addHeader, addNoSignHeader, addNoSignParams, addQuery, attachMetrics, getBucket, getHttpTask, getKeyTime, getMetrics, getNoSignHeaders, getNoSignParams, getPriority, getQueryEncodedString, getQueryString, getRegion, 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, xmlBuilder
public CopyObjectRequest(java.lang.String bucket, java.lang.String cosPath, CopyObjectRequest.CopySourceStruct copySourceStruct)
public java.lang.String getMethod()
CosXmlRequest
RequestMethod
getMethod
在类中 CosXmlRequest
public RequestBodySerializer getRequestBody() throws CosXmlClientException
CosXmlRequest
getRequestBody
在类中 CosXmlRequest
CosXmlClientException
- 客户异常public void checkParameters() throws CosXmlClientException
CosXmlRequest
checkParameters
在类中 ObjectRequest
CosXmlClientException
- cosXmlClientExceptionpublic void setCosPath(java.lang.String cosPath)
setCosPath
在类中 ObjectRequest
cosPath
- 复制的目标cos路径public java.lang.String getCosPath()
getCosPath
在类中 ObjectRequest
public STSCredentialScope[] getSTSCredentialScope(CosXmlServiceConfig config)
CosXmlRequest
getSTSCredentialScope
在类中 CosXmlRequest
config
- SDK服务配置public void setCopySource(CopyObjectRequest.CopySourceStruct copySource, CosXmlServiceConfig config) throws CosXmlClientException
copySource
- 源对象结构体config
- 服务配置信息,用于获取源对象的 URLCosXmlClientException
- 客户端异常public CopyObjectRequest.CopySourceStruct getCopySource()
public void setCopyMetaDataDirective(MetaDataDirective metaDataDirective)
metaDataDirective
- 是否拷贝元数据public void setCopyIfModifiedSince(java.lang.String sourceIfModifiedSince)
sourceIfModifiedSince
- 指定的时间public void setCopyIfUnmodifiedSince(java.lang.String sourceIfUnmodifiedSince)
sourceIfUnmodifiedSince
- 指定的时间public void setCopyIfMatch(java.lang.String eTag)
eTag
- 指定eTagpublic void setCopyIfNoneMatch(java.lang.String eTag)
eTag
- 指定eTagpublic void setCopySourceServerSideEncryptionCustomerKey(java.lang.String sourceKey) throws CosXmlClientException
sourceKey
- 服务端加密密钥CosXmlClientException
- 客户端异常public void setCopySourceServerSideEncryptionKMS(java.lang.String customerKeyID, java.lang.String json) throws CosXmlClientException
customerKeyID
- 用于指定 KMS 的用户主密钥 CMK,如不指定,则使用 COS 默认创建的 CMKjson
- 用于指定加密上下文,值为 JSON 格式加密上下文键值对的 Base64 编码CosXmlClientException
- 客户端代理public void setCosStorageClass(COSStorageClass cosStorageClass)
cosStorageClass
- COS存储类型CosXmlClientException
- 客户端异常public void setXCOSACL(COSACL cosacl)
cosacl
- COS 访问权限public void setXCOSACL(java.lang.String cosacl)
cosacl
- COS 访问权限public void setXCOSGrantRead(ACLAccount aclAccount)
aclAccount
- ACL授权账号列表public void setXCOSGrantWrite(ACLAccount aclAccount)
aclAccount
- ACL授权账号列表public void setXCOSReadWrite(ACLAccount aclAccount)
aclAccount
- ACL授权账号列表public void setXCOSMeta(java.lang.String key, java.lang.String value)
key
- 自定义头部信息的key值,需要以 x-cos-meta- 开头value
- 自定义头部信息的value值。