com.aliyun.oss.model

## 类 CopyObjectRequest

- java.lang.Object
- - com.aliyun.oss.model.WebServiceRequest
  - - com.aliyun.oss.model.CopyObjectRequest

-     public class CopyObjectRequest
      extends WebServiceRequest

  The request class that is used to copy an object. It wraps all parameters needed to copy an object.

- - ### 字段概要

    - ### 从类继承的字段 com.aliyun.oss.model.WebServiceRequest

      `NOOP`

  - ### 构造器概要

    构造器
    构造器和说明
    `CopyObjectRequest(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)` Constructor
    `CopyObjectRequest(String sourceBucketName, String sourceKey, String sourceVersionId, String destinationBucketName, String destinationKey)` Constructs a new `CopyObjectRequest` with basic options, providing an OSS version ID identifying the specific version of the source object to copy.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `clearMatchingETagConstraints()`
    `void` | `clearNonmatchingETagConstraints()`
    `String` | `getDestinationBucketName()` Gets the target bucket name.
    `String` | `getDestinationKey()` Gets the target object key.
    `List<String>` | `getMatchingETagConstraints()` Gets the ETag matching constraints.
    `Date` | `getModifiedSinceConstraint()` Gets the modified since constraint.
    `ObjectMetadata` | `getNewObjectMetadata()` Gets target object's `ObjectMetadata`.
    `List<String>` | `getNonmatchingEtagConstraints()` Gets the ETag non-matching constraints.
    `Payer` | `getRequestPayer()` * Gets the one who pays for the request
    `String` | `getServerSideEncryption()` Gets the target object's server side encryption algorithm.
    `String` | `getServerSideEncryptionKeyId()` Gets the target object's server side encryption key ID.
    `String` | `getSourceBucketName()` Gets the source bucket name.
    `String` | `getSourceKey()` Gets the source object key.
    `String` | `getSourceVersionId()` Gets the version ID specifying which version of the source object to copy.
    `Date` | `getUnmodifiedSinceConstraint()` Gets the unmodified since constraint.
    `void` | `setDestinationBucketName(String destinationBucketName)` Sets the target bucket name.
    `void` | `setDestinationKey(String destinationKey)` Gets the target object key.
    `void` | `setMatchingETagConstraints(List<String> matchingETagConstraints)` Sets the ETag matching constraints.
    `void` | `setModifiedSinceConstraint(Date modifiedSinceConstraint)` Sets the modified since constraint.
    `void` | `setNewObjectMetadata(ObjectMetadata newObjectMetadata)` Sets target object's `ObjectMetadata`.
    `void` | `setNonmatchingETagConstraints(List<String> nonmatchingEtagConstraints)` Sets the ETag non-matching constraints.
    `void` | `setRequestPayer(Payer payer)` * Sets the one who pays for the request The Third party should set request payer when requesting resources.
    `void` | `setServerSideEncryption(String serverSideEncryption)` Sets the target object's server side encryption algorithm.
    `void` | `setServerSideEncryptionKeyId(String serverSideEncryptionKeyId)` Sets the target object's server side encryption key ID.
    `void` | `setSourceBucketName(String sourceBucketName)` Sets the source bucket name.
    `void` | `setSourceKey(String sourceKey)` Sets the source object key.
    `void` | `setSourceVersionId(String sourceVersionId)` Sets the optional version ID specifying which version of the source object to copy.
    `void` | `setUnmodifiedSinceConstraint(Date unmodifiedSinceConstraint)` Sets the unmodified since constraint (optional).

    - ### 从类继承的方法 com.aliyun.oss.model.WebServiceRequest

      `addAdditionalHeaderName, addHeader, addParameter, getAdditionalHeaderNames, getHeaders, getParameters, getProgressListener, isLogEnabled, setAdditionalHeaderNames, setHeaders, setLogEnabled, setParameters, setProgressListener, withProgressListener`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### CopyObjectRequest

          public CopyObjectRequest(String sourceBucketName,
                           String sourceKey,
                           String destinationBucketName,
                           String destinationKey)

      Constructor
      参数:
        `sourceBucketName` - Source bucket name.
        `sourceKey` - Source key.
        `destinationBucketName` - Target bucket name.
        `destinationKey` - Target key.

    - #### CopyObjectRequest

          public CopyObjectRequest(String sourceBucketName,
                           String sourceKey,
                           String sourceVersionId,
                           String destinationBucketName,
                           String destinationKey)

      Constructs a new `CopyObjectRequest` with basic options, providing an OSS version ID identifying the specific version of the source object to copy.

      参数:
        `sourceBucketName` - The name of the OSS bucket containing the object to copy.
        `sourceKey` - The key in the source bucket under which the object to copy is stored.
        `sourceVersionId` - The OSS version ID which uniquely identifies a specific version of the source object to copy.
        `destinationBucketName` - The name of the OSS bucket in which the new object will be copied.
        `destinationKey` - The key in the destination bucket under which the new object will be copied.

  - ### 方法详细资料

    - #### getSourceBucketName

          public String getSourceBucketName()

      Gets the source bucket name.
      返回:
        Source bucket name

    - #### setSourceBucketName

          public void setSourceBucketName(String sourceBucketName)

      Sets the source bucket name.
      参数:
        `sourceBucketName` - Source bucket name.

    - #### getSourceKey

          public String getSourceKey()

      Gets the source object key.
      返回:
        Source object key.

    - #### setSourceKey

          public void setSourceKey(String sourceKey)

      Sets the source object key.
      参数:
        `sourceKey` - Source object key.

    - #### getSourceVersionId

          public String getSourceVersionId()

      Gets the version ID specifying which version of the source object to copy. If not specified, the most recent version of the source object will be copied.

      Objects created before enabling versioning or when versioning is suspended are given the default `null` version ID (see `OSSConstants#NULL_VERSION_ID`). Note that the `null` version ID is a valid version ID and is not the same as not having a version ID.

      返回:
        The version ID specifying which version of the source object to copy.
      另请参阅:
        `OSSConstants#NULL_VERSION_ID`, `setSourceVersionId(String sourceVersionId)`

    - #### setSourceVersionId

          public void setSourceVersionId(String sourceVersionId)

      Sets the optional version ID specifying which version of the source object to copy. If not specified, the most recent version of the source object will be copied.

      Objects created before enabling versioning or when versioning is suspended are given the default `null` version ID (see `OSSConstants#NULL_VERSION_ID`). Note that the `null` version ID is a valid version ID and is not the same as not having a version ID.

      参数:
        `sourceVersionId` - The optional version ID specifying which version of the source object to copy.

    - #### getDestinationBucketName

          public String getDestinationBucketName()

      Gets the target bucket name.
      返回:
        Target bucket name.

    - #### setDestinationBucketName

          public void setDestinationBucketName(String destinationBucketName)

      Sets the target bucket name.
      参数:
        `destinationBucketName` - Target bucket name.

    - #### getDestinationKey

          public String getDestinationKey()

      Gets the target object key.
      返回:
        Target object key.

    - #### setDestinationKey

          public void setDestinationKey(String destinationKey)

      Gets the target object key.
      参数:
        `destinationKey` - Target object key.

    - #### getNewObjectMetadata

          public ObjectMetadata getNewObjectMetadata()

      Gets target object's `ObjectMetadata`.
      返回:
        Target Object `ObjectMetadata`.

    - #### setNewObjectMetadata

          public void setNewObjectMetadata(ObjectMetadata newObjectMetadata)

      Sets target object's `ObjectMetadata`. Optional.
      参数:
        `newObjectMetadata` - Target Object `ObjectMetadata`.

    - #### getMatchingETagConstraints

          public List<String> getMatchingETagConstraints()

      Gets the ETag matching constraints.
      返回:
        ETag matching constraints

    - #### setMatchingETagConstraints

          public void setMatchingETagConstraints(List<String> matchingETagConstraints)

      Sets the ETag matching constraints.
      参数:
        `matchingETagConstraints` - ETag matching constraints.

    - #### clearMatchingETagConstraints

          public void clearMatchingETagConstraints()

    - #### getNonmatchingEtagConstraints

          public List<String> getNonmatchingEtagConstraints()

      Gets the ETag non-matching constraints.
      返回:
        ETag non-matching constraints。

    - #### setNonmatchingETagConstraints

          public void setNonmatchingETagConstraints(List<String> nonmatchingEtagConstraints)

      Sets the ETag non-matching constraints.
      参数:
        `nonmatchingEtagConstraints` - ETag non-matching sontraints.

    - #### clearNonmatchingETagConstraints

          public void clearNonmatchingETagConstraints()

    - #### getUnmodifiedSinceConstraint

          public Date getUnmodifiedSinceConstraint()

      Gets the unmodified since constraint.
      返回:
        The time threshold. If it's same or later than the actual modified time, copy the file.

    - #### setUnmodifiedSinceConstraint

          public void setUnmodifiedSinceConstraint(Date unmodifiedSinceConstraint)

      Sets the unmodified since constraint (optional).
      参数:
        `unmodifiedSinceConstraint` - The time threshold. If it's same or later than the actual modified time, copy the file.

    - #### getModifiedSinceConstraint

          public Date getModifiedSinceConstraint()

      Gets the modified since constraint.
      返回:
        The time threshold. If it's earlier than the actual modified time, copy the file.

    - #### setModifiedSinceConstraint

          public void setModifiedSinceConstraint(Date modifiedSinceConstraint)

      Sets the modified since constraint.
      参数:
        `modifiedSinceConstraint` - The time threshold. If it's earlier than the actual modified time, copy the file.

    - #### getServerSideEncryption

          public String getServerSideEncryption()

      Gets the target object's server side encryption algorithm.
      返回:
        Server side encryption algorithm，null if no encryption.

    - #### setServerSideEncryption

          public void setServerSideEncryption(String serverSideEncryption)

      Sets the target object's server side encryption algorithm.
      参数:
        `serverSideEncryption` - Server side encryption algorithm，null if no encryption.

    - #### getServerSideEncryptionKeyId

          public String getServerSideEncryptionKeyId()

      Gets the target object's server side encryption key ID.
      返回:
        Server side encryption key ID，null if no encryption key ID.

    - #### setServerSideEncryptionKeyId

          public void setServerSideEncryptionKeyId(String serverSideEncryptionKeyId)

      Sets the target object's server side encryption key ID.
      参数:
        `serverSideEncryptionKeyId` - Server side encryption key ID，null if no encryption key ID.

    - #### setRequestPayer

          public void setRequestPayer(Payer payer)

      *

      Sets the one who pays for the request The Third party should set request payer when requesting resources.

      参数:
        `payer` - The one who pays for the request

    - #### getRequestPayer

          public Payer getRequestPayer()

      *

      Gets the one who pays for the request

      返回:
        The one who pays for the request

Copyright © 2020. All Rights Reserved.