com.baidubce.services.bos.model
Class CopyObjectRequest

java.lang.Object
  extended by com.baidubce.model.AbstractBceRequest
      extended by com.baidubce.services.bos.model.GenericBucketRequest
          extended by com.baidubce.services.bos.model.GenericObjectRequest
              extended by com.baidubce.services.bos.model.CopyObjectRequest

public class CopyObjectRequest
extends GenericObjectRequest

Provides options for copying an Baidu Bos object from a source location to a new destination.

All CopyObjectRequests must specify a source bucket and key, along with a destination bucket and key.


Constructor Summary
CopyObjectRequest(String sourceBucketName, String sourceKey, String bucketName, String key)
          Constructs a new CopyObjectRequest with only basic options.
 
Method Summary
 String getETag()
          Gets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.
 String getModifiedSinceConstraint()
          Gets the the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.
 ObjectMetadata getNewObjectMetadata()
          Gets the optional object metadata to set for the new, copied object.
 String getNoneMatchETagConstraint()
          Gets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.
 String getSourceBucketName()
          Gets the name of the bucket containing the source object to be copied.
 String getSourceKey()
          Gets the source bucket key under which the source object to be copied is stored.
 String getStorageClass()
          Gets the storageClass of the input file which is to be copyed to Baidu Bos.
 String getUnmodifiedSinceConstraint()
          Gets the the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.
 void setETag(String eTag)
          Sets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.
 void setModifiedSinceConstraint(String modifiedSinceConstraint)
          Sets the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.
 void setNewObjectMetadata(ObjectMetadata newObjectMetadata)
          Sets the object metadata to use for the new, copied object.
 void setNoneMatchETagConstraint(String noneMatchETagConstraint)
          Sets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.
 void setSourceBucketName(String sourceBucketName)
          Sets the name of the bucket containing the source object to be copied.
 void setSourceKey(String sourceKey)
          Sets the source bucket key under which the source object to be copied is stored.
 void setStorageClass(String storageClass)
          Sets the storageClass of the input file which is to be copyed to Baidu Bos.
 void setUnmodifiedSinceConstraint(String unmodifiedSinceConstraint)
          Sets the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.
 CopyObjectRequest withBucketName(String bucketName)
          Sets the name of the destination bucket which will contain the new, copied object and returns this object, enabling additional method calls to be chained together.
 CopyObjectRequest withETag(String eTag)
          Sets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.
 CopyObjectRequest withKey(String key)
          Sets the destination bucket key under which the new, copied object will be stored and returns this object, enabling additional method calls can be chained together.
 CopyObjectRequest withModifiedSinceConstraint(String modifiedSinceConstraint)
          Sets the the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.
 CopyObjectRequest withNewObjectMetadata(ObjectMetadata newObjectMetadata)
          Sets the object metadata to use for the new, copied object and returns this object, enabling additional method calls to be chained together.
 CopyObjectRequest withNoMatchingETagConstraint(String noneMatchETagConstraint)
          Sets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.
 CopyObjectRequest withRequestCredentials(BceCredentials credentials)
           
 CopyObjectRequest withSourceBucketName(String sourceBucketName)
          Sets the name of the bucket containing the source object to be copied, and returns this object, enabling additional method calls to be chained together.
 CopyObjectRequest withSourceKey(String sourceKey)
          Sets the key in the source bucket under which the source object to be copied is stored and returns this object, enabling additional method calls to be chained together.
 CopyObjectRequest withStorageClass(String storageClass)
          Sets the storageClass of the input file which is to be copyed to Baidu Bos.
 CopyObjectRequest withUnmodifiedSinceConstraint(String unmodifiedSinceConstraint)
          Sets the the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.
 
Methods inherited from class com.baidubce.services.bos.model.GenericObjectRequest
getKey, setKey
 
Methods inherited from class com.baidubce.services.bos.model.GenericBucketRequest
getBucketName, setBucketName
 
Methods inherited from class com.baidubce.model.AbstractBceRequest
getRequestCredentials, setRequestCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyObjectRequest

public CopyObjectRequest(String sourceBucketName,
                         String sourceKey,
                         String bucketName,
                         String key)
Constructs a new CopyObjectRequest with only basic options.

Parameters:
sourceBucketName - The name of the Bos bucket containing the object to copy.
sourceKey - The source bucket key under which the object to copy is stored.
bucketName - The name of the Bos bucket to which the new object will be copied.
key - The destination bucket key under which the new object will be copied.
Method Detail

getSourceBucketName

public String getSourceBucketName()
Gets the name of the bucket containing the source object to be copied.

Returns:
The name of the bucket containing the source object to be copied.

setSourceBucketName

public void setSourceBucketName(String sourceBucketName)
Sets the name of the bucket containing the source object to be copied.

Parameters:
sourceBucketName - The name of the bucket containing the source object to be copied.

withSourceBucketName

public CopyObjectRequest withSourceBucketName(String sourceBucketName)
Sets the name of the bucket containing the source object to be copied, and returns this object, enabling additional method calls to be chained together.

Parameters:
sourceBucketName - The name of the bucket containing the source object to be copied.
Returns:
This CopyObjectRequest instance, enabling additional method calls to be chained together.

getSourceKey

public String getSourceKey()
Gets the source bucket key under which the source object to be copied is stored.

Returns:
The source bucket key under which the source object to be copied is stored.

setSourceKey

public void setSourceKey(String sourceKey)
Sets the source bucket key under which the source object to be copied is stored.

Parameters:
sourceKey - The source bucket key under which the source object to be copied is stored.

withSourceKey

public CopyObjectRequest withSourceKey(String sourceKey)
Sets the key in the source bucket under which the source object to be copied is stored and returns this object, enabling additional method calls to be chained together.

Parameters:
sourceKey - The key in the source bucket under which the source object to be copied is stored.
Returns:
This CopyObjectRequest instance, enabling additional method calls to be chained together.

withRequestCredentials

public CopyObjectRequest withRequestCredentials(BceCredentials credentials)
Specified by:
withRequestCredentials in class AbstractBceRequest

withBucketName

public CopyObjectRequest withBucketName(String bucketName)
Sets the name of the destination bucket which will contain the new, copied object and returns this object, enabling additional method calls to be chained together.

Specified by:
withBucketName in class GenericBucketRequest
Parameters:
bucketName - The name of the destination bucket which will contain the new, copied object.
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

withKey

public CopyObjectRequest withKey(String key)
Sets the destination bucket key under which the new, copied object will be stored and returns this object, enabling additional method calls can be chained together.

Specified by:
withKey in class GenericObjectRequest
Parameters:
key - The destination bucket key under which the new, copied object will be stored.
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

getNewObjectMetadata

public ObjectMetadata getNewObjectMetadata()
Gets the optional object metadata to set for the new, copied object.

Returns:
The object metadata to set for the newly copied object. Returns null if no object metadata has been specified.

setNewObjectMetadata

public void setNewObjectMetadata(ObjectMetadata newObjectMetadata)
Sets the object metadata to use for the new, copied object. By default the object metadata from the source object is copied to the destination object, but when setting object metadata with this method, no metadata from the source object is copied. Instead, the new destination object will have the metadata specified with this call.

Parameters:
newObjectMetadata - The object metadata to use for the newly copied object.

withNewObjectMetadata

public CopyObjectRequest withNewObjectMetadata(ObjectMetadata newObjectMetadata)
Sets the object metadata to use for the new, copied object and returns this object, enabling additional method calls to be chained together. By default, the object metadata from the source object will be copied to the destination object, but if callers set object metadata with this method, it will be used instead.

Parameters:
newObjectMetadata - The object metadata to use for the newly copied object.
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

getETag

public String getETag()
Gets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.

Returns:
The optional ETag that when present must be a match for the source object's current ETag in order for this request to be executed.

setETag

public void setETag(String eTag)
Sets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.

Parameters:
eTag - The optional ETag that when present must be a match for the source object's current ETag in order for this request to be executed.

withETag

public CopyObjectRequest withETag(String eTag)
Sets the optional ETag that, when present, must be a match for the source object's current ETag in order for the copy object request to be executed.

Parameters:
eTag - The optional ETag that when present must be a match for the source object's current ETag in order for this request to be executed.
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

getStorageClass

public String getStorageClass()
Gets the storageClass of the input file which is to be copyed to Baidu Bos.

Returns:
storageClass The storageClass is an identification that distinguish between infrequent access bos and standard bos.

setStorageClass

public void setStorageClass(String storageClass)
Sets the storageClass of the input file which is to be copyed to Baidu Bos.

Parameters:
storageClass - The storageClass is an identification that distinguish between infrequent access bos and standard bos.

withStorageClass

public CopyObjectRequest withStorageClass(String storageClass)
Sets the storageClass of the input file which is to be copyed to Baidu Bos.

Parameters:
storageClass - The StorageClass is an identification that distinguish between infrequent access bos and standard bos.
Returns:
This CopyObjectRequest, so that additional method calls can be chained together.

getUnmodifiedSinceConstraint

public String getUnmodifiedSinceConstraint()
Gets the the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.

Returns:
unmodifiedSinceConstraint

setUnmodifiedSinceConstraint

public void setUnmodifiedSinceConstraint(String unmodifiedSinceConstraint)
Sets the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.

Parameters:
unmodifiedSinceConstraint - the value of the unmodifiedSinceConstraint

withUnmodifiedSinceConstraint

public CopyObjectRequest withUnmodifiedSinceConstraint(String unmodifiedSinceConstraint)
Sets the the value of the unmodifiedSinceConstraint,if the value is equal to or later than the actual file modification time, then take the normal file transfer process.

Parameters:
unmodifiedSinceConstraint - the value of the unmodifiedSinceConstraint
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

getModifiedSinceConstraint

public String getModifiedSinceConstraint()
Gets the the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.

Returns:
modifiedSinceConstraint

setModifiedSinceConstraint

public void setModifiedSinceConstraint(String modifiedSinceConstraint)
Sets the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.

Parameters:
modifiedSinceConstraint - the value of the modifiedSinceConstraint

withModifiedSinceConstraint

public CopyObjectRequest withModifiedSinceConstraint(String modifiedSinceConstraint)
Sets the the value of the modifiedSinceConstraint,if the value is less than the actual file modification time, then take the normal file transfer process.

Parameters:
modifiedSinceConstraint - the value of the modifiedSinceConstraint
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.

getNoneMatchETagConstraint

public String getNoneMatchETagConstraint()
Gets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.

Returns:
noneMatchETagConstraint

setNoneMatchETagConstraint

public void setNoneMatchETagConstraint(String noneMatchETagConstraint)
Sets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.

Parameters:
noneMatchETagConstraint - the constraint value

withNoMatchingETagConstraint

public CopyObjectRequest withNoMatchingETagConstraint(String noneMatchETagConstraint)
Sets the optional ETag that, when present, must be not a match for the source object's current ETag in order for the copy object request to be executed.

Parameters:
noneMatchETagConstraint - the constraint value
Returns:
This CopyObjectRequest, enabling additional method calls to be chained together.


Copyright © 2018. All rights reserved.