public interface COS
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abortMultipartUpload(AbortMultipartUploadRequest request)
Aborts a multipart upload.
|
CompleteMultipartUploadResult |
completeMultipartUpload(CompleteMultipartUploadRequest request)
Completes a multipart upload by assembling previously uploaded parts.
|
CopyObjectResult |
copyObject(CopyObjectRequest copyObjectRequest)
Copy a source object to a new destination in COS.
|
CopyObjectResult |
copyObject(String sourceBucketName,
String sourceKey,
String destinationBucketName,
String destinationKey)
Copy a source object to a new destination in COS.
|
CopyPartResult |
copyPart(CopyPartRequest copyPartRequest)
Copies a source object to a part of a multipart upload.
|
Bucket |
createBucket(CreateBucketRequest createBucketRequest)
Creates a new bucket in the region which is set in ClientConfig
Every object stored in is contained within a bucket.
|
Bucket |
createBucket(String bucketName)
Creates a new bucket in the region which is set in ClientConfig
Every object stored in is contained within a bucket.
|
void |
deleteBucket(DeleteBucketRequest deleteBucketRequest)
Deletes the specified bucket.
|
void |
deleteBucket(String bucketName)
Deletes the specified bucket.
|
void |
deleteBucketCrossOriginConfiguration(DeleteBucketCrossOriginConfigurationRequest deleteBucketCrossOriginConfigurationRequest)
Delete the cross origin configuration for the specified bucket.
|
void |
deleteBucketCrossOriginConfiguration(String bucketName)
Delete the cross origin configuration for the specified bucket.
|
void |
deleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest deleteBucketLifecycleConfigurationRequest)
Removes the lifecycle configuration for the bucket specified.
|
void |
deleteBucketLifecycleConfiguration(String bucketName)
Removes the lifecycle configuration for the bucket specified.
|
void |
deleteBucketReplicationConfiguration(DeleteBucketReplicationConfigurationRequest deleteBucketReplicationConfigurationRequest)
Deletes the replication configuration for the given QCloud bucket.
|
void |
deleteBucketReplicationConfiguration(String bucketName)
Deletes the replication configuration for the given QCloud bucket.
|
void |
deleteObject(DeleteObjectRequest deleteObjectRequest)
Deletes the specified object in the specified bucket.
|
void |
deleteObject(String bucketName,
String key)
Deletes the specified object in the specified bucket.
|
DeleteObjectsResult |
deleteObjects(DeleteObjectsRequest deleteObjectsRequest)
Deletes multiple objects in a single bucket from COS.
|
boolean |
doesBucketExist(String bucketName)
Checks if the specified bucket exists. use this method to determine if a specified bucket
name already exists, and therefore can't be used to create a new bucket.
|
boolean |
doesObjectExist(String bucketName,
String objectName) |
URL |
generatePresignedUrl(GeneratePresignedUrlRequest generatePresignedUrlRequest)
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time.
|
URL |
generatePresignedUrl(String bucketName,
String key,
Date expiration)
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time.
|
URL |
generatePresignedUrl(String bucketName,
String key,
Date expiration,
HttpMethodName method)
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time.
|
AccessControlList |
getBucketAcl(GetBucketAclRequest getBucketAclRequest)
Gets the
AccessControlList (ACL) for the specified bucket. |
AccessControlList |
getBucketAcl(String bucketName)
Gets the
AccessControlList (ACL) for the specified bucket. |
BucketCrossOriginConfiguration |
getBucketCrossOriginConfiguration(GetBucketCrossOriginConfigurationRequest getBucketCrossOriginConfigurationRequest)
Gets the cross origin configuration for the specified bucket, or null if no configuration has
been established.
|
BucketCrossOriginConfiguration |
getBucketCrossOriginConfiguration(String bucketName)
Gets the cross origin configuration for the specified bucket, or null if no configuration has
been established.
|
BucketLifecycleConfiguration |
getBucketLifecycleConfiguration(GetBucketLifecycleConfigurationRequest getBucketLifecycleConfigurationRequest)
Gets the lifecycle configuration for the specified bucket, or null if the specified bucket
does not exist or if no configuration has been established.
|
BucketLifecycleConfiguration |
getBucketLifecycleConfiguration(String bucketName)
Gets the lifecycle configuration for the specified bucket, or null if the specified bucket
does not exist or if no configuration has been established.
|
String |
getBucketLocation(GetBucketLocationRequest getBucketLocationRequest)
Gets the geographical region where stores the specified bucket.
|
String |
getBucketLocation(String bucketName)
Gets the geographical region where stores the specified bucket.
|
BucketReplicationConfiguration |
getBucketReplicationConfiguration(GetBucketReplicationConfigurationRequest getBucketReplicationConfigurationRequest)
Retrieves the replication configuration for the given QCloud bucket.
|
BucketReplicationConfiguration |
getBucketReplicationConfiguration(String bucketName)
Retrieves the replication configuration for the given QCloud bucket.
|
BucketVersioningConfiguration |
getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest)
Returns the versioning configuration for the specified bucket.
|
BucketVersioningConfiguration |
getBucketVersioningConfiguration(String bucketName)
Returns the versioning configuration for the specified bucket.
|
ClientConfig |
getClientConfig()
return the client config. client config include the region info, default expired sign time, etc.
|
COSObject |
getObject(GetObjectRequest getObjectRequest)
Gets the object stored in under the specified bucket and key.
|
ObjectMetadata |
getObject(GetObjectRequest getObjectRequest,
File destinationFile)
Gets the object metadata for the object stored in under the specified bucket and key, and
saves the object contents to the specified file.
|
COSObject |
getObject(String bucketName,
String key)
Gets the object stored in under the specified bucket and key.
|
AccessControlList |
getObjectAcl(GetObjectAclRequest getObjectAclRequest)
Gets the
AccessControlList (ACL) for the specified object in Qcloud COS. |
AccessControlList |
getObjectAcl(String bucketName,
String key)
Gets the
AccessControlList (ACL) for the specified object in Qcloud COS. |
ObjectMetadata |
getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest)
Gets the metadata for the specified object without actually fetching the object itself.
|
ObjectMetadata |
getObjectMetadata(String bucketName,
String key)
Gets the metadata for the specified object without actually fetching the object itself.
|
HeadBucketResult |
headBucket(HeadBucketRequest headBucketRequest)
Performs a head bucket operation on the requested bucket name.
|
InitiateMultipartUploadResult |
initiateMultipartUpload(InitiateMultipartUploadRequest request)
Initiates a multipart upload and returns an InitiateMultipartUploadResult which contains an
upload ID.
|
List<Bucket> |
listBuckets()
Returns a list of all buckets that the authenticated sender of the request owns.
|
List<Bucket> |
listBuckets(ListBucketsRequest listBucketsRequest)
Returns a list of all buckets that the authenticated sender of the request owns.
|
MultipartUploadListing |
listMultipartUploads(ListMultipartUploadsRequest request)
Lists in-progress multipart uploads.
|
ObjectListing |
listNextBatchOfObjects(ListNextBatchOfObjectsRequest listNextBatchOfObjectsRequest)
Provides an easy way to continue a truncated object listing and retrieve the next page of
results.
|
ObjectListing |
listNextBatchOfObjects(ObjectListing previousObjectListing)
Provides an easy way to continue a truncated object listing and retrieve the next page of
results.
|
ObjectListing |
listObjects(ListObjectsRequest listObjectsRequest)
Returns a list of summary information about the objects in the specified bucket.
|
ObjectListing |
listObjects(String bucketName)
Returns a list of summary information about the objects in the specified buckets.
|
ObjectListing |
listObjects(String bucketName,
String prefix)
Returns a list of summary information about the objects in the specified bucket.
|
PartListing |
listParts(ListPartsRequest request)
Lists the parts that have been uploaded for a specific multipart upload.
|
PutObjectResult |
putObject(PutObjectRequest putObjectRequest)
Uploads a new object to the specified bucket.
|
PutObjectResult |
putObject(String bucketName,
String key,
File file)
Uploads the specified file to under the specified bucket and key name.
|
PutObjectResult |
putObject(String bucketName,
String key,
InputStream input,
ObjectMetadata metadata)
Uploads the specified file to under the specified bucket and key name.
|
void |
setBucketAcl(SetBucketAclRequest setBucketAclRequest)
Sets the
AccessControlList for the specified bucket. |
void |
setBucketAcl(String bucketName,
AccessControlList acl)
Sets the
AccessControlList for the specified bucket. |
void |
setBucketAcl(String bucketName,
CannedAccessControlList acl)
Sets the
CannedAccessControlList for the specified bucket. |
void |
setBucketCrossOriginConfiguration(SetBucketCrossOriginConfigurationRequest setBucketCrossOriginConfigurationRequest)
Sets the cross origin configuration for the specified bucket.
|
void |
setBucketCrossOriginConfiguration(String bucketName,
BucketCrossOriginConfiguration bucketCrossOriginConfiguration)
Sets the cross origin configuration for the specified bucket.
|
void |
setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest setBucketLifecycleConfigurationRequest)
Sets the lifecycle configuration for the specified bucket.
|
void |
setBucketLifecycleConfiguration(String bucketName,
BucketLifecycleConfiguration bucketLifecycleConfiguration)
Sets the lifecycle configuration for the specified bucket.
|
void |
setBucketReplicationConfiguration(SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest)
Sets a replication configuration for the QCloud bucket.
|
void |
setBucketReplicationConfiguration(String bucketName,
BucketReplicationConfiguration configuration)
Sets a replication configuration for a bucket.
|
void |
setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest)
Sets the versioning configuration for the specified bucket.
|
void |
setObjectAcl(SetObjectAclRequest setObjectAclRequest)
Sets the
AccessControlList for the specified object. |
void |
setObjectAcl(String bucketName,
String key,
AccessControlList acl)
Sets the
CannedAccessControlList for the specified object. |
void |
setObjectAcl(String bucketName,
String key,
CannedAccessControlList acl)
Sets the
CannedAccessControlList for the specified object. |
UploadPartResult |
uploadPart(UploadPartRequest uploadPartRequest)
Uploads a part in a multipart upload.
|
ClientConfig getClientConfig()
PutObjectResult putObject(PutObjectRequest putObjectRequest) throws CosClientException, CosServiceException
Uploads a new object to the specified bucket. The PutObjectRequest contains all
the details of the request, including the bucket to upload to, the key the object will be
uploaded under, and the file or input stream containing the data to upload.
never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
Depending on whether a file or input stream is being uploaded, this method has slightly different behavior.
When uploading a file:
When uploading directly from an input stream:
The specified bucket must already exist and the caller must have Permission#Write
permission to the bucket to upload an object.
putObjectRequest - The request object containing all the parameters to upload a new
object to .PutObjectResult object containing the information returned by for the newly
created object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.putObject(String, String, File),
putObject(String, String, InputStream, ObjectMetadata)PutObjectResult putObject(String bucketName, String key, File file) throws CosClientException, CosServiceException
Uploads the specified file to under the specified bucket and key name.
never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
The client automatically computes a checksum of the file. uses checksums to validate the data in each file.
Using the file extension, attempts to determine the correct content type and content disposition to use for the object.
The specified bucket must already exist and the caller must have Permission#Write
permission to the bucket to upload an object.
bucketName - The name of an existing bucket, to which you have Permission#Write
permission.key - The key under which to store the specified file.file - The file containing the data to be uploaded to .PutObjectResult object containing the information returned by for the newly
created object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.putObject(PutObjectRequest),
putObject(String, String, InputStream, ObjectMetadata)PutObjectResult putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata) throws CosClientException, CosServiceException
Uploads the specified file to under the specified bucket and key name.
never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored.
When uploading directly from an input stream:
The specified bucket must already exist and the caller must have Permission#Write
permission to the bucket to upload an object.
bucketName - The name of an existing bucket, to which you have Permission#Write
permission.key - The key under which to store the specified file.input - The input stream containing the data to be uploaded to .metadata - Additional metadata instructing how to handle the uploaded data (e.g. custom
user metadata, hooks for specifying content type, etc.).PutObjectResult object containing the information returned by for the newly
created object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.putObject(PutObjectRequest),
putObject(String, String, File)COSObject getObject(String bucketName, String key) throws CosClientException, CosServiceException
Gets the object stored in under the specified bucket and key.
Be extremely careful when using this method; the returned COS object contains a direct stream of data from the HTTP connection. The underlying HTTP connection cannot be closed until the user finishes reading the data and closes the stream. Therefore:
To get an object from , the caller must have Permission#Read access to the object.
If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.
For more advanced options (such as downloading only a range of an object's content, or
placing constraints on when the object should be downloaded) callers can use
getObject(GetObjectRequest).
bucketName - The name of the bucket containing the desired object.key - The key under which the desired object is stored.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.getObject(GetObjectRequest),
getObject(GetObjectRequest, File)COSObject getObject(GetObjectRequest getObjectRequest) throws CosClientException, CosServiceException
Gets the object stored in under the specified bucket and key. Returns null if
the specified constraints weren't met.
Be extremely careful when using this method; the returned COS object contains a direct stream of data from the HTTP connection. The underlying HTTP connection cannot be closed until the user finishes reading the data and closes the stream. Therefore:
If callers do not follow those rules, then the client can run out of resources if allocating too many open, but unused, HTTP connections.
To get an object from , the caller must have Permission#Read access to the object.
If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.
When specifying constraints in the request object, the client needs to be prepared to handle
this method returning null if the provided constraints aren't met when Qcloud
COS receives the request.
If the advanced options provided in GetObjectRequest aren't needed, use the simpler
getObject(String bucketName, String key) method.
getObjectRequest - The request object containing all the options on how to download the
object.null if
constraints were specified but not met.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.getObject(String, String),
getObject(GetObjectRequest, File)ObjectMetadata getObject(GetObjectRequest getObjectRequest, File destinationFile) throws CosClientException, CosServiceException
Gets the object metadata for the object stored in under the specified bucket and key, and
saves the object contents to the specified file. Returns null if the specified
constraints weren't met.
Instead of using getObject(GetObjectRequest), use this method to ensure that the
underlying HTTP stream resources are automatically closed as soon as possible. The clients
handles immediate storage of the object contents to the specified file.
To get an object from , the caller must have Permission#Read access to the object.
If the object fetched is publicly readable, it can also read it by pasting its URL into a browser.
When specifying constraints in the request object, the client needs to be prepared to handle
this method returning null if the provided constraints aren't met when Qcloud
COS receives the request.
getObjectRequest - The request object containing all the options on how to download the
object content.destinationFile - Indicates the file (which might already exist) where to save the
object content being downloading from .null if
constraints were specified but not met.CosClientException - If any errors are encountered in the client while making the
request, handling the response, or writing the incoming data from COS to the
specified destination file.CosServiceException - If any errors occurred in while processing the request.getObject(String, String),
getObject(GetObjectRequest)boolean doesObjectExist(String bucketName, String objectName) throws CosClientException, CosServiceException
bucketName - Name of bucket that presumably contains objectobjectName - Name of object that has to be checkedCosClientException - If any errors are encountered in the client while making the
request, handling the response, or writing the incoming data from COS to the
specified destination file.CosServiceException - If any errors occurred in while processing the request.ObjectMetadata getObjectMetadata(String bucketName, String key) throws CosClientException, CosServiceException
Gets the metadata for the specified object without actually fetching the object itself. This is useful in obtaining only the object metadata, and avoids wasting bandwidth on fetching the object data.
The object metadata contains information such as content type, content disposition, etc., as well as custom user metadata that can be associated with an object in .
bucketName - bucket namekey - cos pathCosClientException - If any errors are encountered on the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.ObjectMetadata getObjectMetadata(GetObjectMetadataRequest getObjectMetadataRequest) throws CosClientException, CosServiceException
Gets the metadata for the specified object without actually fetching the object itself. This is useful in obtaining only the object metadata, and avoids wasting bandwidth on fetching the object data.
The object metadata contains information such as content type, content disposition, etc., as well as custom user metadata that can be associated with an object in .
getObjectMetadataRequest - The request object specifying the bucket, key and optional
version ID of the object whose metadata is being retrieved.CosClientException - If any errors are encountered on the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.getObjectMetadata(String, String)void deleteObject(String bucketName, String key) throws CosClientException, CosServiceException
Deletes the specified object in the specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.
If attempting to delete an object that does not exist, will return a success message instead of an error message.
bucketName - bucket namekey - cos pathCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void deleteObject(DeleteObjectRequest deleteObjectRequest) throws CosClientException, CosServiceException
Deletes the specified object in the specified bucket. Once deleted, the object can only be restored if versioning was enabled when the object was deleted.
If attempting to delete an object that does not exist, will return a success message instead of an error message.
deleteObjectRequest - The request object containing all options for deleting an Qcloud
COS object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.COSClient.deleteObject(String, String)DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest) throws MultiObjectDeleteException, CosClientException, CosServiceException
In some cases, some objects will be successfully deleted, while some attempts will cause an
error. If any object in the request cannot be deleted, this method throws a
MultiObjectDeleteException with details of the error.
deleteObjectsRequest - The request object containing all options for deleting multiple
objects.MultiObjectDeleteException - if one or more of the objects couldn't be deleted.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.Bucket createBucket(String bucketName) throws CosClientException, CosServiceException
Creates a new bucket in the region which is set in ClientConfig
Every object stored in is contained within a bucket. Appid and Bucket partition the namespace of objects stored in at the top level. Within a bucket, any name can be used for objects.
There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.
Buckets cannot be nested; buckets cannot be created within other buckets.
Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.
To create a bucket, authenticate with an account that has a valid Qcloud Access Key ID and is registered with . Anonymous requests are never allowed to create buckets.
bucketName - The name of the bucket to be createdCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.Bucket createBucket(CreateBucketRequest createBucketRequest) throws CosClientException, CosServiceException
Creates a new bucket in the region which is set in ClientConfig
Every object stored in is contained within a bucket. Appid and Bucket partition the namespace of objects stored in at the top level. Within a bucket, any name can be used for objects.
There are no limits to the number of objects that can be stored in a bucket. Performance does not vary based on the number of buckets used. Store all objects within a single bucket or organize them across several buckets.
Buckets cannot be nested; buckets cannot be created within other buckets.
Do not make bucket create or delete calls in the high availability code path of an application. Create or delete buckets in a separate initialization or setup routine that runs less often.
To create a bucket, authenticate with an account that has a valid Qcloud Access Key ID and is registered with . Anonymous requests are never allowed to create buckets.
createBucketRequest - The request object containing all options for creating an Qcloud
COS bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void deleteBucket(String bucketName) throws CosClientException, CosServiceException
Deletes the specified bucket. All objects (and all object versions, if versioning was ever enabled) in the bucket must be deleted before the bucket itself can be deleted.
Only the owner of a bucket can delete it, regardless of the bucket's access control policy (ACL).
bucketName - The name of the bucket to be deletedCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void deleteBucket(DeleteBucketRequest deleteBucketRequest) throws CosClientException, CosServiceException
Deletes the specified bucket. All objects (and all object versions, if versioning was ever enabled) in the bucket must be deleted before the bucket itself can be deleted.
Only the owner of a bucket can delete it, regardless of the bucket's access control policy (ACL).
deleteBucketRequest - The request object containing all options for deleting an Qcloud
COS bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.deleteBucket(String)boolean doesBucketExist(String bucketName) throws CosClientException, CosServiceException
Internally this uses the getBucketAcl(String) operation to determine whether the
bucket exists.
bucketName - The name of the bucket to check.true if the specified bucket exists ; the value
false if there is no bucket with that name.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.HeadBucketResult headBucket(HeadBucketRequest headBucketRequest) throws CosClientException, CosServiceException
headBucketRequest - The request containing the bucket name.HeadBucketResult if the bucket exists and you have
permission to access it. Otherwise, the method will throw an
CosServiceException with status code '404 Not Found' if the bucket
does not exist, '403 Forbidden' if the user does not have access to the
bucketCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.List<Bucket> listBuckets() throws CosClientException, CosServiceException
Returns a list of all buckets that the authenticated sender of the request owns.
CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.List<Bucket> listBuckets(ListBucketsRequest listBucketsRequest) throws CosClientException, CosServiceException
Returns a list of all buckets that the authenticated sender of the request owns.
listBucketsRequest - The request containing all of the options related to the listing of
buckets.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.String getBucketLocation(String bucketName) throws CosClientException, CosServiceException
Gets the geographical region where stores the specified bucket.
To view the location constraint of a bucket, the user must be the bucket owner.
bucketName - The name of the bucket to get locationCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.String getBucketLocation(GetBucketLocationRequest getBucketLocationRequest) throws CosClientException, CosServiceException
Gets the geographical region where stores the specified bucket.
To view the location constraint of a bucket, the user must be the bucket owner.
getBucketLocationRequest - The request object containing the name of the bucket to look
up. This must be a bucket the user owns.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request) throws CosClientException, CosServiceException
uploadPart(UploadPartRequest) requests. You also include this
upload ID in the final request to either complete, or abort the multipart upload request.
Note: After you initiate a multipart upload and upload one or more parts, you must either complete or abort the multipart upload in order to stop getting charged for storage of the uploaded parts. Once you complete or abort the multipart upload will release the stored parts and stop charging you for their storage.
request - The InitiateMultipartUploadRequest object that specifies all the parameters of
this operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.UploadPartResult uploadPart(UploadPartRequest uploadPartRequest) throws CosClientException, CosServiceException
Your UploadPart request must include an upload ID and a part number. The upload ID is the ID returned by in response to your Initiate Multipart Upload request. Part number can be any number between 1 and 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being uploaded. If you upload a new part using the same part number that was specified in uploading a previous part, the previously uploaded part is overwritten.
To ensure data is not corrupted traversing the network, specify the Content-MD5 header in the Upload Part request. checks the part data against the provided MD5 value. If they do not match, returns an error.
When you upload a part, the returned UploadPartResult contains an ETag property. You should record this ETag property value and the part number. After uploading all parts, you must send a CompleteMultipartUpload request. At that time constructs a complete object by concatenating all the parts you uploaded, in ascending order based on the part numbers. The CompleteMultipartUpload request requires you to send all the part numbers and the corresponding ETag values.
Note: After you initiate a multipart upload and upload one or more parts, you must either complete or abort the multipart upload in order to stop getting charged for storage of the uploaded parts. Once you complete or abort the multipart upload will release the stored parts and stop charging you for their storage.
request - The UploadPartRequest object that specifies all the parameters of this
operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.PartListing listParts(ListPartsRequest request) throws CosClientException, CosServiceException
This method must include the upload ID, returned by the
initiateMultipartUpload(InitiateMultipartUploadRequest) operation. This request
returns a maximum of 1000 uploaded parts by default. You can restrict the number of parts
returned by specifying the MaxParts property on the ListPartsRequest. If your multipart
upload consists of more parts than allowed in the ListParts response, the response returns a
IsTruncated field with value true, and a NextPartNumberMarker property. In subsequent
ListParts request you can include the PartNumberMarker property and set its value to the
NextPartNumberMarker property value from the previous response.
request - The ListPartsRequest object that specifies all the parameters of this
operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void abortMultipartUpload(AbortMultipartUploadRequest request) throws CosClientException, CosServiceException
request - The AbortMultipartUploadRequest object that specifies all the parameters of
this operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request) throws CosClientException, CosServiceException
You first upload all parts using the uploadPart(UploadPartRequest) method. After
successfully uploading all individual parts of an upload, you call this operation to complete
the upload. Upon receiving this request, concatenates all the parts in ascending order by
part number to create a new object. In the CompleteMultipartUpload request, you must provide
the parts list. For each part in the list, you provide the part number and the ETag header
value, returned after that part was uploaded.
Processing of a CompleteMultipartUpload request may take several minutes to complete.
request - The CompleteMultipartUploadRequest object that specifies all the parameters of
this operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest request) throws CosClientException, CosServiceException
This operation returns at most 1,000 multipart uploads in the response by default. The number of multipart uploads can be further limited using the MaxUploads property on the request parameter. If there are additional multipart uploads that satisfy the list criteria, the response will contain an IsTruncated property with the value set to true. To list the additional multipart uploads use the KeyMarker and UploadIdMarker properties on the request parameters.
request - The ListMultipartUploadsRequest object that specifies all the parameters of
this operation.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.ObjectListing listObjects(String bucketName) throws CosClientException, CosServiceException
Returns a list of summary information about the objects in the specified buckets. List results are always returned in lexicographic (alphabetical) order.
Because buckets can contain a virtually unlimited number of keys, the complete results of a
list query can be extremely large. To manage large result sets, uses pagination to split them
into multiple responses. Always check the ObjectListing.isTruncated() method to see
if the returned listing is complete or if additional calls are needed to get more results.
Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy
way to get the next page of object listings.
The total number of keys in a bucket doesn't substantially affect list performance.
bucketName - The name of the bucket to list.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.listObjects(String, String),
listObjects(ListObjectsRequest)ObjectListing listObjects(String bucketName, String prefix) throws CosClientException, CosServiceException
Returns a list of summary information about the objects in the specified bucket. Depending on request parameters, additional information is returned, such as common prefixes if a delimiter was specified. List results are always returned in lexicographic (alphabetical) order.
Because buckets can contain a virtually unlimited number of keys, the complete results of a
list query can be extremely large. To manage large result sets, uses pagination to split them
into multiple responses. Always check the ObjectListing.isTruncated() method to see
if the returned listing is complete or if additional calls are needed to get more results.
Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy
way to get the next page of object listings.
For example, consider a bucket that contains the following keys:
listObjects with a prefix value of "foo/" and a
delimiter value of "/" on this bucket, an ObjectListing is returned
that contains one key ("foo/boo") and one entry in the common prefixes list ("foo/bar/"). To
see deeper into the virtual hierarchy, make another call to listObjects setting
the prefix parameter to any interesting common prefix to list the individual keys under that
prefix.
The total number of keys in a bucket doesn't substantially affect list performance.
bucketName - The name of the bucket to list.prefix - An optional parameter restricting the response to keys beginning with the
specified prefix. Use prefixes to separate a bucket into different sets of keys,
similar to how a file system organizes files into directories.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.listObjects(String),
listObjects(ListObjectsRequest)ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws CosClientException, CosServiceException
Returns a list of summary information about the objects in the specified bucket. Depending on the request parameters, additional information is returned, such as common prefixes if a delimiter was specified. List results are always returned in lexicographic (alphabetical) order.
Because buckets can contain a virtually unlimited number of keys, the complete results of a
list query can be extremely large. To manage large result sets, uses pagination to split them
into multiple responses. Always check the ObjectListing.isTruncated() method to see
if the returned listing is complete or if additional calls are needed to get more results.
Alternatively, use the listNextBatchOfObjects(ObjectListing) method as an easy
way to get the next page of object listings.
Calling ListObjectsRequest.setDelimiter(String) sets the delimiter, allowing groups
of keys that share the delimiter-terminated prefix to be included in the returned listing.
This allows applications to organize and browse their keys hierarchically, similar to how a
file system organizes files into directories. These common prefixes can be retrieved through
the ObjectListing.getCommonPrefixes() method.
For example, consider a bucket that contains the following keys:
listObjects with a prefix value of "foo/" and a delimiter value of
"/" on this bucket, an ObjectListing is returned that contains one key
("foo/boo") and one entry in the common prefixes list ("foo/bar/"). To see deeper into the
virtual hierarchy, make another call to listObjects setting the prefix parameter
to any interesting common prefix to list the individual keys under that prefix.
The total number of keys in a bucket doesn't substantially affect list performance.
listObjectsRequest - The request object containing all options for listing the objects
in a specified bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.listObjects(String),
listObjects(String, String)ObjectListing listNextBatchOfObjects(ObjectListing previousObjectListing) throws CosClientException, CosServiceException
Provides an easy way to continue a truncated object listing and retrieve the next page of results.
To continue the object listing and retrieve the next page of results, call the initial
ObjectListing from one of the listObjects methods. If truncated
(indicated when ObjectListing.isTruncated() returns true), pass the
ObjectListing back into this method in order to retrieve the next page of
results. Continue using this method to retrieve more results until the returned
ObjectListing indicates that it is not truncated.
previousObjectListing - The previous truncated ObjectListing. If a
non-truncated ObjectListing is passed in, an empty
ObjectListing is returned without ever contacting .ObjectListing results, beginning immediately after the
last result in the specified previous ObjectListing.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.listObjects(String),
listObjects(String, String),
listObjects(ListObjectsRequest),
listNextBatchOfObjects(ListNextBatchOfObjectsRequest)ObjectListing listNextBatchOfObjects(ListNextBatchOfObjectsRequest listNextBatchOfObjectsRequest) throws CosClientException, CosServiceException
Provides an easy way to continue a truncated object listing and retrieve the next page of results.
To continue the object listing and retrieve the next page of results, call the initial
ObjectListing from one of the listObjects methods. If truncated
(indicated when ObjectListing.isTruncated() returns true), pass the
ObjectListing back into this method in order to retrieve the next page of
results. Continue using this method to retrieve more results until the returned
ObjectListing indicates that it is not truncated.
listNextBatchOfObjectsRequest - The request object for listing next batch of objects
using the previous truncated ObjectListing. If a non-truncated
ObjectListing is passed in by the request object, an empty
ObjectListing is returned without ever contacting .ObjectListing results, beginning immediately after the
last result in the specified previous ObjectListing.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.listObjects(String),
listObjects(String, String),
listObjects(ListObjectsRequest),
listNextBatchOfObjects(ObjectListing)CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey) throws CosClientException, CosServiceException
Copy a source object to a new destination in COS.
To copy an object, the caller's account must have read access to the source object and write access to the destination bucket. cos support copy a object from a diff account, diff region, diff bucket
sourceBucketName - The name of the bucket containing the source object to copy.sourceKey - The key in the source bucket under which the source object is stored.destinationBucketName - The name of the bucket in which the new object will be created.
This can be the same name as the source bucket's.destinationKey - The key in the destination bucket under which the new object will be
created.CopyObjectResult object containing the information returned by about the
newly created object, or null if constraints were specified that weren't
met when attempted to copy the object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.CopyObjectResult copyObject(CopyObjectRequest copyObjectRequest) throws CosClientException, CosServiceException
Copy a source object to a new destination in COS.
To copy an object, the caller's account must have read access to the source object and write access to the destination bucket. cos support copy a object from a diff account, diff region, diff bucket
copyObjectRequest - The request object containing all the options for copying an QCloud
COS object.CopyObjectResult object containing the information returned by about the
newly created object, or null if constraints were specified that weren't
met when attempted to copy the object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.CopyPartResult copyPart(CopyPartRequest copyPartRequest) throws CosClientException, CosServiceException
copyPartRequest - The request object containing all the options for copying an object.null if constraints were specified that weren't met when COS
attempted to copy the object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketLifecycleConfiguration(String bucketName, BucketLifecycleConfiguration bucketLifecycleConfiguration) throws CosClientException, CosServiceException
bucketName - the bucket namebucketLifecycleConfiguration - lifecycle config for the bucketCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketLifecycleConfiguration(SetBucketLifecycleConfigurationRequest setBucketLifecycleConfigurationRequest) throws CosClientException, CosServiceException
setBucketLifecycleConfigurationRequest - The request object containing all options for
setting the bucket lifecycle configuration.CosClientException - If any errors are encountered in the client while making the
`------+++++++++++++++++++++++++++++++++++++++++++++++++* request or handling the
response.CosServiceException - If any errors occurred in while processing the request.BucketLifecycleConfiguration getBucketLifecycleConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - the bucket nameCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.BucketLifecycleConfiguration getBucketLifecycleConfiguration(GetBucketLifecycleConfigurationRequest getBucketLifecycleConfigurationRequest) throws CosClientException, CosServiceException
getBucketLifecycleConfigurationRequest - The request object for retrieving the bucket
lifecycle configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void deleteBucketLifecycleConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - the bucket nameCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void deleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest deleteBucketLifecycleConfigurationRequest) throws CosClientException, CosServiceException
deleteBucketLifecycleConfigurationRequest - The request object containing all options
for removing the bucket lifecycle configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest) throws CosClientException, CosServiceException
Sets the versioning configuration for the specified bucket.
A bucket's versioning configuration can be in one of three possible states:
BucketVersioningConfiguration.OFF
BucketVersioningConfiguration.ENABLED
BucketVersioningConfiguration.SUSPENDED
By default, new buckets are in the off state. Once
versioning is enabled for a bucket the status can never be reverted to
off.
Objects created before versioning was enabled or when versioning is suspended will be given
the default null version ID (see Constants#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 versioning configuration of a bucket has different implications for each operation
performed on that bucket or for objects within that bucket. For example, when versioning is
enabled a PutObject operation creates a unique object version-id for the object
being uploaded. The The PutObject API guarantees that, if versioning is enabled
for a bucket at the time of the request, the new object can only be permanently deleted using
a DeleteVersion operation. It can never be overwritten. Additionally, the
PutObject API guarantees that, if versioning is enabled for a bucket the
request, no other object will be overwritten by that request. Refer to the documentation
sections for each API for information on how versioning status affects the semantics of that
particular API.
setBucketVersioningConfigurationRequest - The request object containing all options for
setting the bucket versioning configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName) throws CosClientException, CosServiceException
Returns the versioning configuration for the specified bucket.
A bucket's versioning configuration can be in one of three possible states:
BucketVersioningConfiguration.OFF
BucketVersioningConfiguration.ENABLED
BucketVersioningConfiguration.SUSPENDED
By default, new buckets are in the off state. Once
versioning is enabled for a bucket the status can never be reverted to
off.
The versioning configuration of a bucket has different implications for each operation
performed on that bucket or for objects within that bucket. For example, when versioning is
enabled a PutObject operation creates a unique object version-id for the object
being uploaded. The The PutObject API guarantees that, if versioning is enabled
for a bucket at the time of the request, the new object can only be permanently deleted using
a DeleteVersion operation. It can never be overwritten. Additionally, the
PutObject API guarantees that, if versioning is enabled for a bucket the
request, no other object will be overwritten by that request.
bucketName - the bucket nameCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest) throws CosClientException, CosServiceException
Returns the versioning configuration for the specified bucket.
A bucket's versioning configuration can be in one of three possible states:
BucketVersioningConfiguration.OFF
BucketVersioningConfiguration.ENABLED
BucketVersioningConfiguration.SUSPENDED
By default, new buckets are in the off state. Once
versioning is enabled for a bucket the status can never be reverted to
off.
The versioning configuration of a bucket has different implications for each operation
performed on that bucket or for objects within that bucket. For example, when versioning is
enabled a PutObject operation creates a unique object version-id for the object
being uploaded. The The PutObject API guarantees that, if versioning is enabled
for a bucket at the time of the request, the new object can only be permanently deleted using
a DeleteVersion operation. It can never be overwritten. Additionally, the
PutObject API guarantees that, if versioning is enabled for a bucket the
request, no other object will be overwritten by that request.
getBucketVersioningConfigurationRequest - The request object for retrieving the bucket
versioning configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.AccessControlList getObjectAcl(String bucketName, String key) throws CosClientException, CosServiceException
Gets the AccessControlList (ACL) for the specified object in Qcloud COS.
Each bucket and object in Qcloud COS has an ACL that defines its access control policy. When a request is made, Qcloud COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Qcloud COS returns an error.
bucketName - The name of the bucket containing the object whose ACL is being retrieved.key - The key of the object within the specified bucket whose ACL is being retrieved.AccessControlList for the specified Qcloud COS object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.AccessControlList getObjectAcl(GetObjectAclRequest getObjectAclRequest) throws CosClientException, CosServiceException
Gets the AccessControlList (ACL) for the specified object in Qcloud COS.
Each bucket and object in Qcloud COS has an ACL that defines its access control policy. When a request is made, Qcloud COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, Qcloud COS returns an error.
getObjectAclRequest - the request object containing all the information needed for
retrieving the object ACL.AccessControlList for the specified Qcloud COS object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setObjectAcl(String bucketName, String key, AccessControlList acl) throws CosClientException, CosServiceException
CannedAccessControlList for the specified object.
Each bucket and object in has an ACL that defines its access control policy. When a request is made, authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, returns an error.
bucketName - The name of the bucket containing the object whose ACL is being set.key - The key of the object within the specified bucket whose ACL is being set.acl - The new AccessControlList for the specified object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setObjectAcl(String bucketName, String key, CannedAccessControlList acl) throws CosClientException, CosServiceException
CannedAccessControlList for the specified object.
Each bucket and object in has an ACL that defines its access control policy. When a request is made, authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, returns an error.
bucketName - The name of the bucket containing the object whose ACL is being set.key - The key of the object within the specified bucket whose ACL is being set.acl - The new pre-configured CannedAccessControlList for the specified
object.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws CosClientException, CosServiceException
AccessControlList for the specified object.
Each bucket and object in has an ACL that defines its access control policy. When a request is made, authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, returns an error.
setObjectAclRequest - The request object containing the COS object to modify and the ACL
to set.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketAcl(String bucketName, AccessControlList acl) throws CosClientException, CosServiceException
AccessControlList for the specified bucket.
Each bucket and object in COS has an ACL that defines its access control policy. When a request is made, COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, COS returns an error.
When constructing a custom AccessControlList, callers typically retrieve the
existing AccessControlList for a bucket .
bucketName - The name of the bucket whose ACL is being setacl - The new pre-configured CannedAccessControlList for the specified COS
bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketAcl(String bucketName, CannedAccessControlList acl) throws CosClientException, CosServiceException
CannedAccessControlList for the specified bucket.
Each bucket and object in COS has an ACL that defines its access control policy. When a request is made, COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, COS returns an error.
When constructing a custom AccessControlList, callers typically retrieve the
existing AccessControlList for a bucket .
bucketName - The name of the bucket whose ACL is being setacl - The AccessControlList for the specified COS bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.void setBucketAcl(SetBucketAclRequest setBucketAclRequest) throws CosClientException, CosServiceException
AccessControlList for the specified bucket.
Each bucket and object in COS has an ACL that defines its access control policy. When a request is made, COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, COS returns an error.
When constructing a custom AccessControlList, callers typically retrieve the
existing AccessControlList for a bucket .
setBucketAclRequest - The request object containing the bucket to modify and the ACL to
set.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in while processing the request.AccessControlList getBucketAcl(String bucketName) throws CosClientException, CosServiceException
AccessControlList (ACL) for the specified bucket.
Each bucket and object in COS has an ACL that defines its access control policy. When a request is made, COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, COS returns an error.
bucketName - The name of the bucket whose ACL is being retrieved.AccessControlList for the specified COS bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.AccessControlList getBucketAcl(GetBucketAclRequest getBucketAclRequest) throws CosClientException, CosServiceException
AccessControlList (ACL) for the specified bucket.
Each bucket and object in COS has an ACL that defines its access control policy. When a request is made, COS authenticates the request using its standard authentication procedure and then checks the ACL to verify the sender was granted access to the bucket or object. If the sender is approved, the request proceeds. Otherwise, COS returns an error.
getBucketAclRequest - The request containing the name of the bucket whose ACL is being
retrieved.AccessControlList for the specified COS bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - the bucket nameCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.BucketCrossOriginConfiguration getBucketCrossOriginConfiguration(GetBucketCrossOriginConfigurationRequest getBucketCrossOriginConfigurationRequest) throws CosClientException, CosServiceException
getBucketCrossOriginConfigurationRequest - The request object for retrieving the bucket
cross origin configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void setBucketCrossOriginConfiguration(String bucketName, BucketCrossOriginConfiguration bucketCrossOriginConfiguration) throws CosClientException, CosServiceException
bucketName - the bucket nameBucketCrossOriginConfiguration - The bucketCrossOriginConfiguration contains all options
for setting the bucket cross origin configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void setBucketCrossOriginConfiguration(SetBucketCrossOriginConfigurationRequest setBucketCrossOriginConfigurationRequest) throws CosClientException, CosServiceException
setBucketCrossOriginConfigurationRequest - The request object containing all options for
setting the bucket cross origin configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void deleteBucketCrossOriginConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - The bucket nameCosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void deleteBucketCrossOriginConfiguration(DeleteBucketCrossOriginConfigurationRequest deleteBucketCrossOriginConfigurationRequest) throws CosClientException, CosServiceException
deleteBucketCrossOriginConfigurationRequest - The request object containing all options
for deleting the bucket cross origin configuration.CosClientExceptionCosServiceExceptionvoid setBucketReplicationConfiguration(String bucketName, BucketReplicationConfiguration configuration) throws CosClientException, CosServiceException
bucketName - The bucket name for which the replication configuration is set.configuration - The replication configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void setBucketReplicationConfiguration(SetBucketReplicationConfigurationRequest setBucketReplicationConfigurationRequest) throws CosClientException, CosServiceException
setBucketReplicationConfigurationRequest - The request object containing all the options
for setting a replication configuration for QCloud bucket.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.BucketReplicationConfiguration getBucketReplicationConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - The bucket name for which the replication configuration is to be retrieved.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.BucketReplicationConfiguration getBucketReplicationConfiguration(GetBucketReplicationConfigurationRequest getBucketReplicationConfigurationRequest) throws CosClientException, CosServiceException
getBucketReplicationConfigurationRequest - The request object for retrieving the bucket
replication configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void deleteBucketReplicationConfiguration(String bucketName) throws CosClientException, CosServiceException
bucketName - The bucket name for which the replication configuration is to be deleted.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.void deleteBucketReplicationConfiguration(DeleteBucketReplicationConfigurationRequest deleteBucketReplicationConfigurationRequest) throws CosClientException, CosServiceException
deleteBucketReplicationConfigurationRequest - The request object for delete bucket
replication configuration.CosClientException - If any errors are encountered in the client while making the
request or handling the response.CosServiceException - If any errors occurred in COS while processing the request.URL generatePresignedUrl(String bucketName, String key, Date expiration) throws CosClientException
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time. Defaults, if you didn't set the expiration time, the expired time of ClientConfig will be used.
Pre-signed URLs allow clients to form a URL for an COS resource, and then sign it with the current COS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's security credentials.
Pre-signed URLs are useful in many situations where COS security credentials aren't available from the client that needs to make the actual request to COS.
For example, an application may need remote users to upload files to the application owner's COS bucket, but doesn't need to ship the COS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's COS security credentials, then the pre-signed URL can be passed to the end user's application to use.
bucketName - The name of the bucket containing the desired object.key - The key in the specified bucket under which the desired object is stored.expiration - The time at which the returned pre-signed URL will expire.CosClientException - If any errors are encountered in the client while making the
request or handling the response.generatePresignedUrl(String, String, Date),
generatePresignedUrl(String, String, Date, HttpMethodName)URL generatePresignedUrl(String bucketName, String key, Date expiration, HttpMethodName method) throws CosClientException
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time. Defaults, if you didn't set the expiration time, the expired time of ClientConfig will be used.
Pre-signed URLs allow clients to form a URL for an COS resource, and then sign it with the current COS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's security credentials.
Pre-signed URLs are useful in many situations where COS security credentials aren't available from the client that needs to make the actual request to COS.
For example, an application may need remote users to upload files to the application owner's COS bucket, but doesn't need to ship the COS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's COS security credentials, then the pre-signed URL can be passed to the end user's application to use.
bucketName - The name of the bucket containing the desired object.key - The key in the specified bucket under which the desired object is stored.expiration - The time at which the returned pre-signed URL will expire.method - The HTTP method verb to use for this URLCosClientException - If any errors are encountered in the client while making the
request or handling the response.generatePresignedUrl(String, String, Date),
generatePresignedUrl(String, String, Date, HttpMethodName)URL generatePresignedUrl(GeneratePresignedUrlRequest generatePresignedUrlRequest) throws CosClientException
Returns a pre-signed URL for accessing COS resource. you can specify the expiration time. Defaults, if you didn't set the expiration time, the expired time of ClientConfig will be used.
Pre-signed URLs allow clients to form a URL for an COS resource, and then sign it with the current COS security credentials. The pre-signed URL can be shared to other users, allowing access to the resource without providing an account's security credentials.
Pre-signed URLs are useful in many situations where COS security credentials aren't available from the client that needs to make the actual request to COS.
For example, an application may need remote users to upload files to the application owner's COS bucket, but doesn't need to ship the COS security credentials with the application. A pre-signed URL to PUT an object into the owner's bucket can be generated from a remote location with the owner's COS security credentials, then the pre-signed URL can be passed to the end user's application to use.
generatePresignedUrlRequest - The request object containing all the options for
generating a pre-signed URL (bucket name, key, expiration date, etc).CosClientException - If any errors are encountered in the client while making the
request or handling the response.generatePresignedUrl(String, String, Date),
COS#generatePresignedUrl(String, String, Date, HttpMethod)Copyright © 2017. All rights reserved.