public class BosClient extends AbstractBceClient
| Modifier and Type | Field and Description |
|---|---|
static String |
RESTORE_TIER_EXPEDITED
Expedited restore tier
|
static String |
RESTORE_TIER_LOWCOST
LowCost restore tier
|
static String |
RESTORE_TIER_STANDARD
Standard restore tier
|
static String |
STORAGE_CLASS_ARCHIVE
Archive access BOS storage class
|
static String |
STORAGE_CLASS_COLD
Cold access BOS storage class
|
static String |
STORAGE_CLASS_STANDARD
Standard BOS storage class
|
static String |
STORAGE_CLASS_STANDARD_IA
Infrequent access BOS storage class
|
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX| Constructor and Description |
|---|
BosClient()
Constructs a new client to invoke service methods on Bos.
|
BosClient(BosClientConfiguration clientConfiguration)
Constructs a new Bos client using the client configuration to access Bos.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortMultipartUpload(AbortMultipartUploadRequest request)
Aborts a multipart upload.
|
void |
abortMultipartUpload(String bucketName,
String key,
String uploadId)
Aborts a multipart upload.
|
AppendObjectResponse |
appendObject(AppendObjectRequest request)
Uploads a new object to the specified Bos bucket.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
byte[] value)
Uploads the specified bytes to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
byte[] value,
ObjectMetadata metadata)
Uploads the appendable bytes and object metadata to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
File file)
Uploads the specified appendable file to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
File file,
ObjectMetadata metadata)
Uploads the specified appendable file to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
InputStream input)
Uploads the appendable input stream to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
InputStream input,
ObjectMetadata metadata)
Uploads the appendable input stream and object metadata to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
String value)
Uploads the specified string to Bos under the specified bucket and key name.
|
AppendObjectResponse |
appendObject(String bucketName,
String key,
String value,
ObjectMetadata metadata)
Uploads the specified string and object metadata to Bos under the specified bucket and key name.
|
CompleteMultipartUploadResponse |
completeMultipartUpload(CompleteMultipartUploadRequest request)
Completes a multipart upload by assembling previously uploaded parts.
|
CompleteMultipartUploadResponse |
completeMultipartUpload(String bucketName,
String key,
String uploadId,
List<PartETag> partETags)
Completes a multipart upload by assembling previously uploaded parts.
|
CompleteMultipartUploadResponse |
completeMultipartUpload(String bucketName,
String key,
String uploadId,
List<PartETag> partETags,
ObjectMetadata metadata)
Completes a multipart upload by assembling previously uploaded parts.
|
CopyObjectResponse |
copyObject(CopyObjectRequest request)
Copies a source object to a new destination in Bos.
|
CopyObjectResponse |
copyObject(String sourceBucketName,
String sourceKey,
String destinationBucketName,
String destinationKey)
Copies a source object to a new destination in Bos.
|
CreateBucketResponse |
createBucket(CreateBucketRequest request)
Creates a new Bos bucket with the specified name.
|
CreateBucketResponse |
createBucket(String bucketName)
Creates a new Bos bucket with the specified name.
|
void |
deleteBucket(DeleteBucketRequest request)
Deletes the specified bucket.
|
void |
deleteBucket(String bucketName)
Deletes the specified bucket.
|
void |
deleteBucketCopyrightProtection(DeleteBucketCopyrightProtectionRequest request)
Delete Bucket copyrightprotection
|
void |
deleteBucketCopyrightProtection(String bucketName)
Delete Bucket copyrightprotection
|
void |
deleteBucketCors(DeleteBucketCorsRequest request)
Delete the CORS for the specified Bos bucket.
|
void |
deleteBucketEncryption(DeleteBucketEncryptionRequest request)
Delete Bucket Encryption
|
void |
deleteBucketEncryption(String bucketName)
Delete Bucket Encryption
|
void |
deleteBucketLifecycle(DeleteBucketLifecycleRequest request)
Delete the Lifecycle for the specified Bos bucket.
|
void |
deleteBucketLogging(DeleteBucketLoggingRequest request)
Delete the Logging for the specified Bos bucket.
|
void |
deleteBucketMirroring(DeleteBucketMirroringRequest request)
Delete the Bos bucket mirroring setting.
|
void |
deleteBucketMirroring(String bucketName)
Delete the Bos bucket mirroring setting.
|
void |
deleteBucketReplication(DeleteBucketReplicationRequest request)
Deletes the replication for the specified Bos bucket with specified replicationId.
|
void |
deleteBucketStaticWebSite(DeleteBucketStaticWebsiteRequest request)
Delete bucket static website
|
void |
deleteBucketStaticWebSite(String bucketName)
Delete bucket static website
|
DeleteMultipleObjectsResponse |
deleteMultipleObjects(DeleteMultipleObjectsRequest request)
Deletes the multiple specified objects in the specified bucket.
|
void |
deleteObject(DeleteObjectRequest request)
Deletes the specified object in the specified bucket.
|
void |
deleteObject(String bucketName,
String key)
Deletes the specified object in the specified bucket.
|
void |
deleteObjectAcl(DeleteObjectAclRequest request)
Delete Object Acl for specified object in the specified bucket.
|
boolean |
doesBucketExist(DoesBucketExistRequest request)
Checks if the specified bucket exists.
|
boolean |
doesBucketExist(String bucketName)
Checks if the specified bucket exists.
|
boolean |
doesObjectExist(String bucketName,
String key)
Checks if the specified object exists.
|
FetchObjectResponse |
fetchObject(FetchObjectRequest request)
Fetches a source object to a new destination in Bos.
|
FetchObjectResponse |
fetchObject(String bucketName,
String key,
String sourceUrl)
Fetches a source object to a new destination in Bos.
|
FetchObjectResponse |
fetchObject(String bucketName,
String key,
String sourceUrl,
String mode)
Fetches a source object to a new destination in Bos.
|
URL |
generatePresignedUrl(GeneratePresignedUrlRequest request)
Returns a pre-signed URL for accessing a Bos resource.
|
URL |
generatePresignedUrl(String bucketName,
String key,
int expirationInSeconds)
Returns a pre-signed URL for accessing a Bos resource.
|
URL |
generatePresignedUrl(String bucketName,
String key,
int expirationInSeconds,
HttpMethodName method)
Returns a pre-signed URL for accessing a Bos resource.
|
User |
getBosAccountOwner()
Gets the current owner of the Bos account that the authenticated sender of the request is using.
|
User |
getBosAccountOwner(GetBosAccountOwnerRequest request)
Gets the current owner of the Bos account that the authenticated sender of the request is using.
|
GetBucketAclResponse |
getBucketAcl(GetBucketAclRequest request)
Gets the ACL for the specified Bos bucket.
|
GetBucketAclResponse |
getBucketAcl(String bucketName)
Gets the ACL for the specified Bos bucket.
|
GetBucketCopyrightProtectionResponse |
getBucketCopyrightProtection(GetBucketCopyrightProtectionRequest request)
Get bucket copyrightprotection
|
GetBucketCopyrightProtectionResponse |
getBucketCopyrightProtection(String bucketName)
Get bucket copyrightprotection
|
GetBucketCorsResponse |
getBucketCros(GetBucketCorsRequest request)
Gets the CORS for the specified Bos bucket.
|
GetBucketEncryptionResponse |
getBucketEncryption(GetBucketEncryptionRequest request)
Get Bucket Encryption
|
GetBucketEncryptionResponse |
getBucketEncryption(String bucketName)
Get Bucket Encryption
|
GetBucketLifecycleResponse |
getBucketLifecycle(GetBucketLifecycleRequest request)
Gets Lifecycle for the specified Bos bucket.
|
GetBucketLocationResponse |
getBucketLocation(GetBucketLocationRequest request)
Gets the Location for the specified Bos bucket.
|
GetBucketLocationResponse |
getBucketLocation(String bucketName)
Gets the Location for the specified Bos bucket.
|
GetBucketLoggingResponse |
getBucketLogging(GetBucketLoggingRequest request)
Gets the Logging for the specified Bos bucket.
|
GetBucketMirroringResponse |
getBucketMirroring(GetBucketMirroringRequest request)
Gets the Bos bucket mirroring description.
|
GetBucketMirroringResponse |
getBucketMirroring(String bucketName)
Gets the Bos bucket mirroring description.
|
GetBucketReplicationResponse |
getBucketReplication(GetBucketReplicationRequest request)
Gets the replication for the specified Bos bucket with specified replicationId.
|
BucketReplicationProgress |
getBucketReplicationProgress(GetBucketReplicationProgressRequest request)
Gets the bucket replication progress for the specified Bos bucket with specified replicationId
|
GetBucketStaticWebsiteResponse |
getBucketStaticWebsite(GetBucketStaticWebsiteRequest request)
Get bucket static website
|
GetBucketStaticWebsiteResponse |
getBucketStaticWebsite(String bucketName)
Get bucket static website
|
GetBucketStorageClassResponse |
getBucketStorageClass(GetBucketStorageClassRequest request)
Gets the default storageClass for the specified Bos bucket.
|
GetBucketStorageClassResponse |
getBucketStorageClass(String bucketName)
Gets the default storageClass for the specified Bos bucket.
|
BosObject |
getObject(GetObjectRequest request)
Gets the object stored in Bos under the specified bucket and key.
|
ObjectMetadata |
getObject(GetObjectRequest request,
File destinationFile)
Gets the object metadata for the object stored in Bos under the specified bucket and key,
and saves the object contents to the specified file.
|
BosObject |
getObject(String bucketName,
String key)
Gets the object stored in Bos under the specified bucket and key.
|
ObjectMetadata |
getObject(String bucketName,
String key,
File destinationFile)
Gets the object metadata for the object stored in Bos under the specified bucket and key,
and saves the object contents to the specified file.
|
GetObjectAclResponse |
getObjectAcl(GetObjectAclRequest request)
Get Object Acl for specified object in the specified bucket.
|
byte[] |
getObjectContent(GetObjectRequest request)
Gets the object content stored in Bos under the specified bucket and key.
|
byte[] |
getObjectContent(String bucketName,
String key)
Gets the object content stored in Bos under the specified bucket and key.
|
ObjectMetadata |
getObjectMetadata(GetObjectMetadataRequest request)
Gets the metadata for the specified Bos object without actually fetching the object itself.
|
ObjectMetadata |
getObjectMetadata(String bucketName,
String key)
Gets the metadata for the specified Bos object without actually fetching the object itself.
|
GetObjectSymlinkResponse |
getObjectSymlink(GetObjectSymlinkRequest request)
Gets the specified object symlink in the specified bucket
|
GetObjectSymlinkResponse |
getObjectSymlink(String bucketName,
String key)
Gets the specified object symlink in the specified bucket
|
HeadBucketResponse |
headBucket(HeadBucketRequest request)
Gets the res whether the bucket exists, bucket type
|
HeadBucketResponse |
headBucket(String bucketName)
Gets the res whether the bucket exists, bucket type
|
InitiateMultipartUploadResponse |
initiateMultipartUpload(InitiateMultipartUploadRequest request)
Initiates a multipart upload and returns an InitiateMultipartUploadResponse
which contains an upload ID.
|
InitiateMultipartUploadResponse |
initiateMultipartUpload(String bucketName,
String key)
Initiates a multipart upload and returns an InitiateMultipartUploadResponse
which contains an upload ID.
|
ListBucketReplicationResponse |
listBucketReplication(ListBucketReplicationRequest request)
List all bucket replication
|
ListBucketsResponse |
listBuckets()
Returns a list of all Bos buckets that the authenticated sender of the request owns.
|
ListBucketsResponse |
listBuckets(ListBucketsRequest request)
Returns a list of all Bos buckets that the authenticated sender of the request owns.
|
ListMultipartUploadsResponse |
listMultipartUploads(ListMultipartUploadsRequest request)
Lists in-progress multipart uploads.
|
ListMultipartUploadsResponse |
listMultipartUploads(String bucketName)
Lists in-progress multipart uploads.
|
ListObjectsResponse |
listNextBatchOfObjects(ListObjectsResponse previousResponse)
Provides an easy way to continue a truncated object listing and retrieve the next page of results.
|
ListObjectsResponse |
listObjects(ListObjectsRequest request)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.
|
ListObjectsResponse |
listObjects(String bucketName)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.
|
ListObjectsResponse |
listObjects(String bucketName,
String prefix)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.
|
ListPartsResponse |
listParts(ListPartsRequest request)
Lists the parts that have been uploaded for a specific multipart upload.
|
ListPartsResponse |
listParts(String bucketName,
String key,
String uploadId)
Lists the parts that have been uploaded for a specific multipart upload.
|
void |
putBucketMirroring(PutBucketMirroringRequest request)
Set the Bos bucket mirroring.
|
void |
putBucketMirroring(String bucketName,
List<BucketMirroringConfiguration> bucketMirroringConfigurations)
Set the Bos bucket mirroring.
|
void |
putBucketMirroring(String bucketName,
String jsonBucketMirroringConfigurations)
Set the Bos bucket mirroring.
|
void |
putBucketStorageClass(PutBucketStorageClassRequest request)
Sets the default storageClass for the specified Bos bucket.
|
void |
putBucketStorageClass(String bucketName,
String storageClass)
Sets the default storageClass for the specified Bos bucket.
|
PutObjectResponse |
putObject(PutObjectRequest request)
Uploads a new object to the specified Bos bucket.
|
PutObjectResponse |
putObject(String bucketName,
String key,
byte[] value)
Uploads the specified bytes to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
byte[] value,
ObjectMetadata metadata)
Uploads the specified bytes and object metadata to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
File file)
Uploads the specified file to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
File file,
ObjectMetadata metadata)
Uploads the specified file and object metadata to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
InputStream input)
Uploads the specified input stream to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
InputStream input,
BosProgressCallback progressCallback)
Uploads the specified input stream and object metadata to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
InputStream input,
ObjectMetadata metadata)
Uploads the specified input stream and object metadata to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
String value)
Uploads the specified string to Bos under the specified bucket and key name.
|
PutObjectResponse |
putObject(String bucketName,
String key,
String value,
ObjectMetadata metadata)
Uploads the specified string and object metadata to Bos under the specified bucket and key name.
|
boolean |
putSuperObjectFromFile(File file,
String bucketName,
String objectKey)
The Encapsulation of three-step upload when put Super Object from file
|
boolean |
putSuperObjectFromFile(File file,
String bucketName,
String objectKey,
int nThreads)
The Encapsulation of three-step upload when put Super Object from file
|
boolean |
putSuperObjectFromFile(File file,
String bucketName,
String objectKey,
long chunksize)
The Encapsulation of three-step upload when put Super Object from file
|
boolean |
putSuperObjectFromFile(File file,
String bucketName,
String objectKey,
long chunksize,
int nThreads)
The Encapsulation of three-step upload when put Super Object from file
|
boolean |
putSuperObjectFromFile(PutSuperObjectRequest putSuperObjectRequest) |
void |
restoreObject(RestoreObjectRequest request)
Restore an archive object to the specified Bos bucket
|
void |
restoreObject(String bucketName,
String key)
Restore an archive object to the specified Bos bucket
|
void |
restoreObject(String bucketName,
String key,
int restoreDays,
String restoreTier)
Restore an archive object to the specified Bos bucket
|
SelectObjectResponse |
selectObject(SelectObjectRequest request) |
void |
setBucketAcl(SetBucketAclRequest request)
Sets the Acl for the specified Bos bucket.
|
void |
setBucketAcl(String bucketName,
CannedAccessControlList acl)
Sets the CannedAccessControlList for the specified Bos bucket using one of
the pre-configured
CannedAccessControlLists. |
void |
setBucketAcl(String bucketName,
String jsonAcl)
Sets the json style of bucket acl for the specified Bos bucket using one of
the pre-configured
CannedAccessControlLists. |
void |
setBucketBucketLifecycle(SetBucketLifecycleRequest request)
Sets the Lifecycle for the specified Bos bucket.
|
void |
setBucketCopyrightProtection(SetBucketCopyrightProtectionRequest request)
Set bucket CopyrightProtection
|
void |
setBucketCopyrightProtection(String bucketName,
List<String> resources)
Set bucket CopyrightProtection
|
void |
setBucketCors(SetBucketCorsRequest request)
Sets the CORS for the specified Bos bucket.
|
void |
setBucketEncryption(SetBucketEncryptionRequest request)
Set bucket encryption
|
void |
setBucketEncryption(String bucketName,
BucketEncryption encryption)
Set bucket encryption
|
void |
setBucketLogging(SetBucketLoggingRequest request)
Sets the Logging for the specified Bos bucket.
|
void |
setBucketReplication(SetBucketReplicationRequest request)
Sets the replication for the specified Bos bucket with specified replicationId.
|
void |
setBucketStaticWebSite(SetBucketStaticWebsiteRequest request)
Set bucket website
|
void |
setBucketStaticWebSite(String bucketName,
String index,
String notfound)
Set bucket website
|
void |
setObjectAcl(SetObjectAclRequest request)
Set Object Acl for specified object in the specified bucket.
|
void |
setObjectAcl(String bucketName,
String objectKey,
CannedAccessControlList acl)
Set Object Acl for specified object in the specified bucket.
|
void |
setObjectAcl(String bucketName,
String objectKey,
String jsonObjectAcl)
Set Object Acl for specified object in the specified bucket.
|
SetObjectSymlinkResponse |
setObjectSymlink(SetObjectSymlinkRequest request)
Set the specified object symlink in the specified bucket.
|
SetObjectSymlinkResponse |
setObjectSymlink(String bucketName,
String key,
String symlinkTarget)
Set the specified object symlink in the specified bucket.
|
StateSummaryResponse |
stateSummary(StateSummaryRequest request) |
StateSummaryResponse |
stateSummary(String bucketName) |
StateSummaryResponse |
stateSummary(String bucketName,
String prefix) |
boolean |
uploadFilePart(PutSuperObjectRequest putSuperObjectRequest,
int partNum,
List<PartETag> partETags) |
UploadPartResponse |
uploadPart(UploadPartRequest request)
Uploads a part in a multipart upload.
|
UploadPartCopyResponse |
uploadPartCopy(UploadPartCopyRequest request)
Uploads a copy part in a multipart upload.
|
computeBktVirEndpoint, computeServiceId, getBktVirEndpoint, getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdownpublic static final String STORAGE_CLASS_STANDARD
public static final String STORAGE_CLASS_STANDARD_IA
public static final String STORAGE_CLASS_COLD
public static final String STORAGE_CLASS_ARCHIVE
public static final String RESTORE_TIER_STANDARD
public static final String RESTORE_TIER_EXPEDITED
public static final String RESTORE_TIER_LOWCOST
public BosClient()
public BosClient(BosClientConfiguration clientConfiguration)
clientConfiguration - The bos client configuration options controlling how this client
connects to Bos (e.g. proxy settings, retry counts, etc).public User getBosAccountOwner()
The caller must authenticate with a valid BCE Access Key ID that is registered with Bos.
public User getBosAccountOwner(GetBosAccountOwnerRequest request)
The caller must authenticate with a valid BCE Access Key ID that is registered with Bos.
request - This request containing the credentials for getting the account of the authenticated sender.public ListBucketsResponse listBuckets()
Users must authenticate with a valid BCE Access Key ID that is registered with Bos. Anonymous requests cannot list buckets, and users cannot list buckets that they did not create.
public ListBucketsResponse listBuckets(ListBucketsRequest request)
Users must authenticate with a valid BCE Access Key ID that is registered with Bos. Anonymous requests cannot list buckets, and users cannot list buckets that they did not create.
request - The request containing all of the options related to the listing of buckets.public CreateBucketResponse createBucket(String bucketName)
bucketName - The name of the bucket to create.
All buckets in Bos share a single namespace; ensure the bucket is given a unique name.public CreateBucketResponse createBucket(CreateBucketRequest request)
request - The request object containing all options for creating a Bos bucket.public boolean doesBucketExist(String bucketName)
If invalid security credentials are used to execute this method, the client is not able to distinguish between bucket permission errors and invalid credential errors, and this method could return an incorrect result.
bucketName - The name of the bucket to check.true if the specified bucket exists in Bos;
the value false if there is no bucket in Bos with that name.public boolean doesBucketExist(DoesBucketExistRequest request)
If invalid security credentials are used to execute this method, the client is not able to distinguish between bucket permission errors and invalid credential errors, and this method could return an incorrect result.
request - The request object containing all options for checking a Bos bucket.true if the specified bucket exists in Bos;
the value false if there is no bucket in Bos with that name.public GetBucketAclResponse getBucketAcl(String bucketName)
Each bucket and object in Bos has an ACL that defines its access control policy. When a request is made, Bos 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, Bos returns an error.
bucketName - The name of the bucket whose ACL is being retrieved.GetBuckeetAclResponse for the specified Bos bucket.public GetBucketAclResponse getBucketAcl(GetBucketAclRequest request)
Each bucket and object in Bos has an ACL that defines its access control policy. When a request is made, Bos 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, Bos returns an error.
request - The request containing the name of the bucket whose ACL is being retrieved.GetBuckeetAclResponse for the specified Bos bucket.public GetBucketLocationResponse getBucketLocation(String bucketName)
Each bucket and object in Bos has an Location that defines its location
bucketName - The name of the bucket whose Location is being retrieved.GetBuckeetLocationResponse for the specified Bos bucket.public GetBucketLocationResponse getBucketLocation(GetBucketLocationRequest request)
Each bucket and object in Bos has an Location that defines its location
request - The request containing the name of the bucket whose Location is being retrieved.GetBuckeetLocationResponse for the specified Bos bucket.public void putBucketStorageClass(String bucketName, String storageClass)
A json style of bucket storageClass
provides a storageClass to configure an bucket.
bucketName - The name of the bucket whose storageClass is being set.storageClass - The pre-configured storageClass to set for the specified bucket.public void putBucketStorageClass(PutBucketStorageClassRequest request)
A json style of bucket storageClass
provides a storageClass to configure an bucket.
request - The request containing the name of the bucket and the default storageClass.public GetBucketStorageClassResponse getBucketStorageClass(String bucketName)
bucketName - The bucket whose storageClass to to get.public GetBucketStorageClassResponse getBucketStorageClass(GetBucketStorageClassRequest request)
request - The request object containing the specified bucket to get bucket logging.public void setBucketAcl(String bucketName, String jsonAcl)
CannedAccessControlLists.
A json style of bucket acl
provides a quick way to configure an object or bucket with commonly used
access control policies.
bucketName - The name of the bucket whose ACL is being set.jsonAcl - The pre-configured CannedAccessControlLists to set for the specified bucket.public void setBucketAcl(String bucketName, CannedAccessControlList acl)
CannedAccessControlLists.
A CannedAccessControlList
provides a quick way to configure an object or bucket with commonly used
access control policies.
bucketName - The name of the bucket whose ACL is being set.acl - The pre-configured CannedAccessControlLists to set for the specified bucket.public void setBucketAcl(SetBucketAclRequest request)
request - The request object containing the bucket to modify and the ACL to set.public void setBucketLogging(SetBucketLoggingRequest request)
request - The request object containing the Logging to set into specified bucket.public GetBucketLoggingResponse getBucketLogging(GetBucketLoggingRequest request)
request - The request object containing the specified bucket to get bucket logging.public void deleteBucketLogging(DeleteBucketLoggingRequest request)
request - The request object containing the specified bucket to delete bucket logging.public void setBucketCors(SetBucketCorsRequest request)
request - The request object containing the CORS to set into specified bucket.public GetBucketCorsResponse getBucketCros(GetBucketCorsRequest request)
request - The request object containing the specified bucket to get bucket CORS.public void deleteBucketCors(DeleteBucketCorsRequest request)
request - The request object containing the specified bucket to delete bucket CORS.public void setBucketReplication(SetBucketReplicationRequest request)
request - public GetBucketReplicationResponse getBucketReplication(GetBucketReplicationRequest request)
public void deleteBucketReplication(DeleteBucketReplicationRequest request)
public BucketReplicationProgress getBucketReplicationProgress(GetBucketReplicationProgressRequest request)
public ListBucketReplicationResponse listBucketReplication(ListBucketReplicationRequest request)
public void setBucketBucketLifecycle(SetBucketLifecycleRequest request)
request - The request object containing the Lifecycle to set into specified bucket.public GetBucketLifecycleResponse getBucketLifecycle(GetBucketLifecycleRequest request)
request - The request object containing the specified bucket to get bucket Lifecycle.public void deleteBucketLifecycle(DeleteBucketLifecycleRequest request)
request - The request object containing the specified bucket to delete bucket Lifecycle.public void deleteBucket(String bucketName)
Only the owner of a bucket can delete it, regardless of the bucket's access control policy.
bucketName - The name of the bucket to delete.public void deleteBucket(DeleteBucketRequest request)
Only the owner of a bucket can delete it, regardless of the bucket's access control policy.
request - The request object containing all options for deleting a Bos bucket.public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds)
bucketName - The name of the bucket containing the desired object.key - The key in the specified bucket under which the desired object is stored.expirationInSeconds - The expiration after which the returned pre-signed URL will expire.public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds, HttpMethodName method)
bucketName - The name of the bucket containing the desired object.key - The key in the specified bucket under which the desired object is stored.expirationInSeconds - The expiration after which the returned pre-signed URL will expire.method - The HTTP method verb to use for this URLpublic URL generatePresignedUrl(GeneratePresignedUrlRequest request)
request - The request object containing all the options for generating a
pre-signed URL (bucket name, key, expiration date, etc).public ListObjectsResponse listObjects(String bucketName)
bucketName - The name of the Bos bucket to list.public ListObjectsResponse listObjects(String bucketName, String prefix)
bucketName - The name of the Bos 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.public ListObjectsResponse listObjects(ListObjectsRequest request)
request - The request object containing all options for listing the objects in a specified bucket.public ListObjectsResponse listNextBatchOfObjects(ListObjectsResponse previousResponse)
previousResponse - The previous truncated ListObjectsResponse. If a non-truncated
ListObjectsResponse is passed in, an empty ListObjectsResponse
is returned without ever contacting Bos.ListObjectsResponse results, beginning immediately
after the last result in the specified previous ListObjectsResponse.public BosObject getObject(String bucketName, String key)
bucketName - The name of the bucket containing the desired object.key - The key under which the desired object is stored.public ObjectMetadata getObject(String bucketName, String key, File destinationFile)
null if the specified constraints weren't met.bucketName - The name of the bucket containing the desired object.key - The key under which the desired object is stored.destinationFile - Indicates the file (which might already exist)
where to save the object content being downloading from Bos.null if constraints were specified but not met.public BosObject getObject(GetObjectRequest request)
request - The request object containing all the options on how to download the object.public ObjectMetadata getObject(GetObjectRequest request, File destinationFile)
null if the specified constraints weren't met.request - The request object containing all the options on how to download the Bos object content.destinationFile - Indicates the file (which might already exist) where to save the object
content being downloading from Bos.null if constraints were specified but not met.public byte[] getObjectContent(String bucketName, String key)
bucketName - The name of the bucket containing the desired object.key - The key under which the desired object is stored.public byte[] getObjectContent(GetObjectRequest request)
request - The request object containing all the options on how to download the Bos object content.public boolean doesObjectExist(String bucketName, String key)
If invalid security credentials are used to execute this method, the client is not able to distinguish between bucket permission errors and invalid credential errors, and this method could return an incorrect result.
bucketName - The name of the bucketkey - The name of the object to check.true if the specified object exists in Bos;
the value false if there is no object in Bos with that name.public ObjectMetadata getObjectMetadata(String bucketName, String key)
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 Bos.
bucketName - The name of the bucket containing the object's whose metadata is being retrieved.key - The key of the object whose metadata is being retrieved.public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest request)
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 Bos.
request - The request object specifying the bucket, key whose metadata is being retrieved.public PutObjectResponse putObject(String bucketName, String key, File file)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.file - The file containing the data to be uploaded to Bos.public PutObjectResponse putObject(String bucketName, String key, File file, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.file - The file containing the data to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectResponse putObject(String bucketName, String key, String value)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The string containing the value to be uploaded to Bos.public PutObjectResponse putObject(String bucketName, String key, String value, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The string containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectResponse putObject(String bucketName, String key, byte[] value)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The bytes containing the value to be uploaded to Bos.public PutObjectResponse putObject(String bucketName, String key, byte[] value, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The bytes containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectResponse putObject(String bucketName, String key, InputStream input)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.input - The input stream containing the value to be uploaded to Bos.public PutObjectResponse putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.input - The input stream containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectResponse putObject(String bucketName, String key, InputStream input, BosProgressCallback progressCallback)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.input - The input stream containing the value to be uploaded to Bos.progressCallback - The BosProgressCallback, which used for get progress information.
(e.g. custom user metadata, hooks for specifying content type, etc.).public PutObjectResponse putObject(PutObjectRequest request)
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.request - The request object containing all the parameters to upload a new object to Bos.public CopyObjectResponse copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)
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.public CopyObjectResponse copyObject(CopyObjectRequest request)
request - The request object containing all the options for copying an Bos object.public FetchObjectResponse fetchObject(String bucketName, String key, String sourceUrl)
bucketName - The name of the bucket in which the new object will be created.key - The key in the destination bucket under which the new object will be created.sourceUrl - The url full path for fetching.public FetchObjectResponse fetchObject(String bucketName, String key, String sourceUrl, String mode)
bucketName - The name of the bucket in which the new object will be created.key - The key in the destination bucket under which the new object will be created.sourceUrl - The url full path for fetching.mode - The mode path for fetching.public FetchObjectResponse fetchObject(FetchObjectRequest request)
request - The request object containing all the options for fetching url to a Bos object.public void deleteObject(String bucketName, String key)
bucketName - The name of the Bos bucket containing the object to delete.key - The key of the object to delete.public void deleteObject(DeleteObjectRequest request)
request - The request object containing all options for deleting a Bos object.public SetObjectSymlinkResponse setObjectSymlink(String bucketName, String key, String symlinkTarget)
bucketName - The name of the Bos bucket containing the objectkey - The object's symlink namesymlinkTarget - The target object of the symlinkpublic SetObjectSymlinkResponse setObjectSymlink(SetObjectSymlinkRequest request)
request - The request object containing all options for setting a symlink of target object.public GetObjectSymlinkResponse getObjectSymlink(String bucketName, String key)
bucketName - The name of the Bos bucket containing the symlink objectkey - The symlink namepublic GetObjectSymlinkResponse getObjectSymlink(GetObjectSymlinkRequest request)
request - The request object containing all options for getting a symlink of target object.public DeleteMultipleObjectsResponse deleteMultipleObjects(DeleteMultipleObjectsRequest request)
request - The request object containing all options for deleting a Bos multiple objects.public void setObjectAcl(String bucketName, String objectKey, String jsonObjectAcl)
bucketName - objectKey - jsonObjectAcl - The json format of specified object.public void setObjectAcl(String bucketName, String objectKey, CannedAccessControlList acl)
bucketName - objectKey - acl - The CannedAccessControlList of specified object.public void setObjectAcl(SetObjectAclRequest request)
request - The request object containing all options for setting a Bos object acl.public GetObjectAclResponse getObjectAcl(GetObjectAclRequest request)
request - The request object containing all options for getting a Bos object acl.public void deleteObjectAcl(DeleteObjectAclRequest request)
request - The request object containing all options for deleting a Bos object acl.public InitiateMultipartUploadResponse initiateMultipartUpload(String bucketName, String key)
bucketName - The name of the Bos bucket containing the object to initiate.key - The key of the object to initiate.public InitiateMultipartUploadResponse initiateMultipartUpload(InitiateMultipartUploadRequest request)
request - The InitiateMultipartUploadRequest object that specifies all the parameters of this operation.public UploadPartResponse uploadPart(UploadPartRequest request)
request - The UploadPartRequest object that specifies all the parameters of this operation.public UploadPartCopyResponse uploadPartCopy(UploadPartCopyRequest request)
request - The UploadPartCopyRequest object that specifies all the parameters of this operation.public ListPartsResponse listParts(String bucketName, String key, String uploadId)
bucketName - The name of the bucket containing the multipart upload whose parts are being listed.key - The key of the associated multipart upload whose parts are being listed.uploadId - The ID of the multipart upload whose parts are being listed.public ListPartsResponse listParts(ListPartsRequest request)
request - The ListPartsRequest object that specifies all the parameters of this operation.public CompleteMultipartUploadResponse completeMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags)
bucketName - The name of the bucket containing the multipart upload to complete.key - The key of the multipart upload to complete.uploadId - The ID of the multipart upload to complete.partETags - The list of part numbers and ETags to use when completing the multipart upload.public CompleteMultipartUploadResponse completeMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags, ObjectMetadata metadata)
bucketName - The name of the bucket containing the multipart upload to complete.key - The key of the multipart upload to complete.uploadId - The ID of the multipart upload to complete.partETags - The list of part numbers and ETags to use when completing the multipart upload.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request)
request - The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.public void abortMultipartUpload(String bucketName, String key, String uploadId)
bucketName - The name of the bucket containing the multipart upload to abort.key - The key of the multipart upload to abort.uploadId - The ID of the multipart upload to abort.public void abortMultipartUpload(AbortMultipartUploadRequest request)
request - The AbortMultipartUploadRequest object that specifies all the parameters of this operation.public ListMultipartUploadsResponse listMultipartUploads(String bucketName)
bucketName - The name of the bucket containing the uploads to list.public ListMultipartUploadsResponse listMultipartUploads(ListMultipartUploadsRequest request)
request - The ListMultipartUploadsRequest object that specifies all the parameters of this operation.public AppendObjectResponse appendObject(String bucketName, String key, File file)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.file - The appendable file containing the data to be uploaded to Bos.public AppendObjectResponse appendObject(String bucketName, String key, File file, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.file - The file containing the data to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public AppendObjectResponse appendObject(String bucketName, String key, String value)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The string containing the value to be uploaded to Bos.public AppendObjectResponse appendObject(String bucketName, String key, String value, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The string containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public AppendObjectResponse appendObject(String bucketName, String key, byte[] value)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The bytes containing the value to be uploaded to Bos.public AppendObjectResponse appendObject(String bucketName, String key, byte[] value, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.value - The bytes containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public AppendObjectResponse appendObject(String bucketName, String key, InputStream input)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.input - The input stream containing the value to be uploaded to Bos.public AppendObjectResponse appendObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)
bucketName - The name of an existing bucket, to which you have Write permission.key - The key under which to store the specified file.input - The input stream containing the value to be uploaded to Bos.metadata - Additional metadata instructing Bos how to handle the uploaded data
(e.g. custom user metadata, hooks for specifying content type, etc.).public AppendObjectResponse appendObject(AppendObjectRequest request)
AppendObjectRequest 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.request - The request object containing all the parameters to upload a new appendable object to Bos.public void restoreObject(String bucketName, String key)
bucketName - The name of rsestore an archive object.key - The key of rsestore an archive object.public void restoreObject(String bucketName, String key, int restoreDays, String restoreTier)
bucketName - The name of rsestore an archive object.key - The key of rsestore an archive object.restoreDays - The times after restore an archive object.restoreTier - The speed of rsestore an archive object.public void restoreObject(RestoreObjectRequest request)
request - The request object containing all the parameters to restore an archive objectpublic void setBucketEncryption(String bucketName, BucketEncryption encryption)
bucketName - The name of an existing bucket, to which you have Write permission.encryption - The encryption of bucketpublic void setBucketEncryption(SetBucketEncryptionRequest request)
public GetBucketEncryptionResponse getBucketEncryption(String bucketName)
bucketName - The name of an existing bucketpublic GetBucketEncryptionResponse getBucketEncryption(GetBucketEncryptionRequest request)
request - public void deleteBucketEncryption(String bucketName)
bucketName - The name of an existing bucket, to which you have Write permission.public void deleteBucketEncryption(DeleteBucketEncryptionRequest request)
request - public void setBucketStaticWebSite(String bucketName, String index, String notfound)
bucketName - The name of an existing bucket, to which you have Write permission.index - The index page for staticwebsitenotfound - The notFound page for staticwebsitepublic void setBucketStaticWebSite(SetBucketStaticWebsiteRequest request)
request - public GetBucketStaticWebsiteResponse getBucketStaticWebsite(String bucketName)
bucketName - The name of an existing bucket, to which you have Read permission.public GetBucketStaticWebsiteResponse getBucketStaticWebsite(GetBucketStaticWebsiteRequest request)
request - public void deleteBucketStaticWebSite(String bucketName)
bucketName - The name of an existing bucket, to which you have Write permission.public void deleteBucketStaticWebSite(DeleteBucketStaticWebsiteRequest request)
request - public void setBucketCopyrightProtection(String bucketName, List<String> resources)
bucketName - The name of an existing bucket, to which you have Write permissionresources - The resourceList of Bucket CopyrightProtectionpublic void setBucketCopyrightProtection(SetBucketCopyrightProtectionRequest request)
public GetBucketCopyrightProtectionResponse getBucketCopyrightProtection(String bucketName)
bucketName - The name of an existing bucket, to which you have Read permissionpublic GetBucketCopyrightProtectionResponse getBucketCopyrightProtection(GetBucketCopyrightProtectionRequest request)
request - public void deleteBucketCopyrightProtection(String bucketName)
bucketName - The name of an existing bucket, to which you have Write permissionpublic void deleteBucketCopyrightProtection(DeleteBucketCopyrightProtectionRequest request)
request - public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey)
file - super objectbucketName - The name of an existing bucket, to which you have Write permission.objectKey - The key under which to store the specified file.public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize)
file - super objectbucketName - The name of an existing bucket, to which you have Write permission.objectKey - The key under which to store the specified file.chunksize - the part size when upload super object filepublic boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, int nThreads)
file - super objectbucketName - The name of an existing bucket, to which you have Write permission.objectKey - The key under which to store the specified file.nThreads - The num of threads in thread poolpublic boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize, int nThreads)
file - super objectbucketName - The name of an existing bucket, to which you have Write permission.objectKey - The key under which to store the specified file.chunksize - the part size when upload super object filenThreads - The num of threads in thread poolpublic boolean putSuperObjectFromFile(PutSuperObjectRequest putSuperObjectRequest)
public boolean uploadFilePart(PutSuperObjectRequest putSuperObjectRequest, int partNum, List<PartETag> partETags)
public SelectObjectResponse selectObject(SelectObjectRequest request)
public StateSummaryResponse stateSummary(String bucketName)
public StateSummaryResponse stateSummary(String bucketName, String prefix)
public StateSummaryResponse stateSummary(StateSummaryRequest request)
public HeadBucketResponse headBucket(String bucketName)
bucketName - The name of the checked bucketHeadBucketResponse for the specified Bos bucket.public HeadBucketResponse headBucket(HeadBucketRequest request)
request - containing the name the checked bucketHeadBucketResponse for the specified Bos bucket.public GetBucketMirroringResponse getBucketMirroring(String bucketName)
bucketName - The name of an existing bucket, to which you have permissionGetBucketMirroringResponse for the Bos bucket.public GetBucketMirroringResponse getBucketMirroring(GetBucketMirroringRequest request)
request - The GetBucketMirroringRequest you createGetBucketMirroringResponse for the Bos bucket.public void putBucketMirroring(String bucketName, List<BucketMirroringConfiguration> bucketMirroringConfigurations)
bucketName - The name of an existing bucket, to which you have permissionbucketMirroringConfigurations - The bucketMirroringConfigurations object that your createpublic void putBucketMirroring(String bucketName, String jsonBucketMirroringConfigurations)
bucketName - The name of an existing bucket, to which you have permissionjsonBucketMirroringConfigurations - The bucketMirroringConfigurations json string that your createpublic void putBucketMirroring(PutBucketMirroringRequest request)
request - The PutBucketMirroringRequest you createpublic void deleteBucketMirroring(String bucketName)
bucketName - The name of an existing bucket, to which you have permissionpublic void deleteBucketMirroring(DeleteBucketMirroringRequest request)
request - The DeleteBucketMirroringRequest you createCopyright © 2023. All rights reserved.