类 BosClient
- java.lang.Object
-
- com.baidubce.AbstractBceClient
-
- com.baidubce.services.bos.BosClient
-
public class BosClient extends AbstractBceClient
Provides the client for accessing the Baidu Object Service.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringRESTORE_TIER_EXPEDITEDExpedited restore tierstatic StringRESTORE_TIER_LOWCOSTLowCost restore tierstatic StringRESTORE_TIER_STANDARDStandard restore tierstatic StringSTORAGE_CLASS_ARCHIVEArchive access BOS storage classstatic StringSTORAGE_CLASS_COLDCold access BOS storage classstatic StringSTORAGE_CLASS_STANDARDStandard BOS storage classstatic StringSTORAGE_CLASS_STANDARD_IAInfrequent access BOS storage class-
从类继承的字段 com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
-
-
构造器概要
构造器 构造器 说明 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.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidabortMultipartUpload(AbortMultipartUploadRequest request)Aborts a multipart upload.voidabortMultipartUpload(String bucketName, String key, String uploadId)Aborts a multipart upload.AppendObjectResponseappendObject(AppendObjectRequest request)Uploads a new object to the specified Bos bucket.AppendObjectResponseappendObject(String bucketName, String key, byte[] value)Uploads the specified bytes to Bos under the specified bucket and key name.AppendObjectResponseappendObject(String bucketName, String key, byte[] value, ObjectMetadata metadata)Uploads the appendable bytes and object metadata to Bos under the specified bucket and key name.AppendObjectResponseappendObject(String bucketName, String key, File file)Uploads the specified appendable file to Bos under the specified bucket and key name.AppendObjectResponseappendObject(String bucketName, String key, File file, ObjectMetadata metadata)Uploads the specified appendable file to Bos under the specified bucket and key name.AppendObjectResponseappendObject(String bucketName, String key, InputStream input)Uploads the appendable input stream to Bos under the specified bucket and key name.AppendObjectResponseappendObject(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.AppendObjectResponseappendObject(String bucketName, String key, String value)Uploads the specified string to Bos under the specified bucket and key name.AppendObjectResponseappendObject(String bucketName, String key, String value, ObjectMetadata metadata)Uploads the specified string and object metadata to Bos under the specified bucket and key name.CompleteMultipartUploadResponsecompleteMultipartUpload(CompleteMultipartUploadRequest request)Completes a multipart upload by assembling previously uploaded parts.CompleteMultipartUploadResponsecompleteMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags)Completes a multipart upload by assembling previously uploaded parts.CompleteMultipartUploadResponsecompleteMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags, ObjectMetadata metadata)Completes a multipart upload by assembling previously uploaded parts.CopyObjectResponsecopyObject(CopyObjectRequest request)Copies a source object to a new destination in Bos.CopyObjectResponsecopyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)Copies a source object to a new destination in Bos.CreateBucketResponsecreateBucket(CreateBucketRequest request)Creates a new Bos bucket with the specified name.CreateBucketResponsecreateBucket(String bucketName)Creates a new Bos bucket with the specified name.voiddeleteBucket(DeleteBucketRequest request)Deletes the specified bucket.voiddeleteBucket(String bucketName)Deletes the specified bucket.voiddeleteBucketCopyrightProtection(DeleteBucketCopyrightProtectionRequest request)Delete Bucket copyrightprotectionvoiddeleteBucketCopyrightProtection(String bucketName)Delete Bucket copyrightprotectionvoiddeleteBucketCors(DeleteBucketCorsRequest request)Delete the CORS for the specified Bos bucket.voiddeleteBucketEncryption(DeleteBucketEncryptionRequest request)Delete Bucket EncryptionvoiddeleteBucketEncryption(String bucketName)Delete Bucket EncryptionvoiddeleteBucketLifecycle(DeleteBucketLifecycleRequest request)Delete the Lifecycle for the specified Bos bucket.voiddeleteBucketLogging(DeleteBucketLoggingRequest request)Delete the Logging for the specified Bos bucket.voiddeleteBucketMirroring(DeleteBucketMirroringRequest request)Delete the Bos bucket mirroring setting.voiddeleteBucketMirroring(String bucketName)Delete the Bos bucket mirroring setting.voiddeleteBucketReplication(DeleteBucketReplicationRequest request)Deletes the replication for the specified Bos bucket with specified replicationId.voiddeleteBucketStaticWebSite(DeleteBucketStaticWebsiteRequest request)Delete bucket static websitevoiddeleteBucketStaticWebSite(String bucketName)Delete bucket static websitevoiddeleteBucketTagging(DeleteBucketTaggingRequest request)Delete the Bos bucket tagging setting.voiddeleteBucketTagging(String bucketName)Delete the Bos bucket tagging setting.voiddeleteBucketTrash(DeleteBucketTrashRequest request)Delete the Bos bucket trash.voiddeleteBucketTrash(String bucketName)Delete the Bos bucket trash.DeleteMultipleObjectsResponsedeleteMultipleObjects(DeleteMultipleObjectsRequest request)Deletes the multiple specified objects in the specified bucket.voiddeleteObject(DeleteObjectRequest request)Deletes the specified object in the specified bucket.voiddeleteObject(String bucketName, String key)Deletes the specified object in the specified bucket.voiddeleteObjectAcl(DeleteObjectAclRequest request)Delete Object Acl for specified object in the specified bucket.booleandoesBucketExist(DoesBucketExistRequest request)Checks if the specified bucket exists.booleandoesBucketExist(String bucketName)Checks if the specified bucket exists.booleandoesObjectExist(String bucketName, String key)Checks if the specified object exists.FetchObjectResponsefetchObject(FetchObjectRequest request)Fetches a source object to a new destination in Bos.FetchObjectResponsefetchObject(String bucketName, String key, String sourceUrl)Fetches a source object to a new destination in Bos.FetchObjectResponsefetchObject(String bucketName, String key, String sourceUrl, String mode)Fetches a source object to a new destination in Bos.URLgeneratePresignedUrl(GeneratePresignedUrlRequest request)Returns a pre-signed URL for accessing a Bos resource.URLgeneratePresignedUrl(String bucketName, String key, int expirationInSeconds)Returns a pre-signed URL for accessing a Bos resource.URLgeneratePresignedUrl(String bucketName, String key, int expirationInSeconds, HttpMethodName method)Returns a pre-signed URL for accessing a Bos resource.UsergetBosAccountOwner()Gets the current owner of the Bos account that the authenticated sender of the request is using.UsergetBosAccountOwner(GetBosAccountOwnerRequest request)Gets the current owner of the Bos account that the authenticated sender of the request is using.GetBucketAclResponsegetBucketAcl(GetBucketAclRequest request)Gets the ACL for the specified Bos bucket.GetBucketAclResponsegetBucketAcl(String bucketName)Gets the ACL for the specified Bos bucket.GetBucketCopyrightProtectionResponsegetBucketCopyrightProtection(GetBucketCopyrightProtectionRequest request)Get bucket copyrightprotectionGetBucketCopyrightProtectionResponsegetBucketCopyrightProtection(String bucketName)Get bucket copyrightprotectionGetBucketCorsResponsegetBucketCros(GetBucketCorsRequest request)Gets the CORS for the specified Bos bucket.GetBucketEncryptionResponsegetBucketEncryption(GetBucketEncryptionRequest request)Get Bucket EncryptionGetBucketEncryptionResponsegetBucketEncryption(String bucketName)Get Bucket EncryptionGetBucketLifecycleResponsegetBucketLifecycle(GetBucketLifecycleRequest request)Gets Lifecycle for the specified Bos bucket.GetBucketLocationResponsegetBucketLocation(GetBucketLocationRequest request)Gets the Location for the specified Bos bucket.GetBucketLocationResponsegetBucketLocation(String bucketName)Gets the Location for the specified Bos bucket.GetBucketLoggingResponsegetBucketLogging(GetBucketLoggingRequest request)Gets the Logging for the specified Bos bucket.GetBucketMirroringResponsegetBucketMirroring(GetBucketMirroringRequest request)Gets the Bos bucket mirroring description.GetBucketMirroringResponsegetBucketMirroring(String bucketName)Gets the Bos bucket mirroring description.GetBucketReplicationResponsegetBucketReplication(GetBucketReplicationRequest request)Gets the replication for the specified Bos bucket with specified replicationId.BucketReplicationProgressgetBucketReplicationProgress(GetBucketReplicationProgressRequest request)Gets the bucket replication progress for the specified Bos bucket with specified replicationIdGetBucketStaticWebsiteResponsegetBucketStaticWebsite(GetBucketStaticWebsiteRequest request)Get bucket static websiteGetBucketStaticWebsiteResponsegetBucketStaticWebsite(String bucketName)Get bucket static websiteGetBucketStorageClassResponsegetBucketStorageClass(GetBucketStorageClassRequest request)Gets the default storageClass for the specified Bos bucket.GetBucketStorageClassResponsegetBucketStorageClass(String bucketName)Gets the default storageClass for the specified Bos bucket.GetBucketTaggingResponsegetBucketTagging(GetBucketTaggingRequest request)Gets the Bos bucket tagging description.GetBucketTaggingResponsegetBucketTagging(String bucketName)Gets the Bos bucket tagging description.GetBucketTrashResponsegetBucketTrash(GetBucketTrashRequest request)Get the Bos bucket trash.GetBucketTrashResponsegetBucketTrash(String bucketName)Get the Bos bucket trash.BosObjectgetObject(GetObjectRequest request)Gets the object stored in Bos under the specified bucket and key.ObjectMetadatagetObject(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.BosObjectgetObject(String bucketName, String key)Gets the object stored in Bos under the specified bucket and key.ObjectMetadatagetObject(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.GetObjectAclResponsegetObjectAcl(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.ObjectMetadatagetObjectMetadata(GetObjectMetadataRequest request)Gets the metadata for the specified Bos object without actually fetching the object itself.ObjectMetadatagetObjectMetadata(String bucketName, String key)Gets the metadata for the specified Bos object without actually fetching the object itself.GetObjectSymlinkResponsegetObjectSymlink(GetObjectSymlinkRequest request)Gets the specified object symlink in the specified bucketGetObjectSymlinkResponsegetObjectSymlink(String bucketName, String key)Gets the specified object symlink in the specified bucketHeadBucketResponseheadBucket(HeadBucketRequest request)Gets the res whether the bucket exists, bucket typeHeadBucketResponseheadBucket(String bucketName)Gets the res whether the bucket exists, bucket typeInitiateMultipartUploadResponseinitiateMultipartUpload(InitiateMultipartUploadRequest request)Initiates a multipart upload and returns an InitiateMultipartUploadResponse which contains an upload ID.InitiateMultipartUploadResponseinitiateMultipartUpload(String bucketName, String key)Initiates a multipart upload and returns an InitiateMultipartUploadResponse which contains an upload ID.ListBucketReplicationResponselistBucketReplication(ListBucketReplicationRequest request)List all bucket replicationListBucketsResponselistBuckets()Returns a list of all Bos buckets that the authenticated sender of the request owns.ListBucketsResponselistBuckets(ListBucketsRequest request)Returns a list of all Bos buckets that the authenticated sender of the request owns.ListMultipartUploadsResponselistMultipartUploads(ListMultipartUploadsRequest request)Lists in-progress multipart uploads.ListMultipartUploadsResponselistMultipartUploads(String bucketName)Lists in-progress multipart uploads.ListObjectsResponselistNextBatchOfObjects(ListObjectsResponse previousResponse)Provides an easy way to continue a truncated object listing and retrieve the next page of results.ListObjectsResponselistObjects(ListObjectsRequest request)Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.ListObjectsResponselistObjects(String bucketName)Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.ListObjectsResponselistObjects(String bucketName, String prefix)Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets.ListPartsResponselistParts(ListPartsRequest request)Lists the parts that have been uploaded for a specific multipart upload.ListPartsResponselistParts(String bucketName, String key, String uploadId)Lists the parts that have been uploaded for a specific multipart upload.voidputBucketMirroring(PutBucketMirroringRequest request)Set the Bos bucket mirroring.voidputBucketMirroring(String bucketName, String jsonBucketMirroringConfigurations)Set the Bos bucket mirroring.voidputBucketMirroring(String bucketName, List<BucketMirroringConfiguration> bucketMirroringConfigurations)Set the Bos bucket mirroring.voidputBucketStorageClass(PutBucketStorageClassRequest request)Sets the default storageClass for the specified Bos bucket.voidputBucketStorageClass(String bucketName, String storageClass)Sets the default storageClass for the specified Bos bucket.voidputBucketTagging(PutBucketTaggingRequest request)Set the Bos bucket tagging.voidputBucketTagging(String bucketName, String jsonBucketTags)Set the Bos bucket tagging.voidputBucketTagging(String bucketName, List<BucketTag> tags)Set the Bos bucket tagging.voidputBucketTrash(PutBucketTrashRequest request)Set the Bos bucket trash.voidputBucketTrash(String bucketName)Set the Bos bucket trash.voidputBucketTrash(String bucketName, String trashDir)Set the Bos bucket trash.PutObjectResponseputObject(PutObjectRequest request)Uploads a new object to the specified Bos bucket.PutObjectResponseputObject(String bucketName, String key, byte[] value)Uploads the specified bytes to Bos under the specified bucket and key name.PutObjectResponseputObject(String bucketName, String key, byte[] value, ObjectMetadata metadata)Uploads the specified bytes and object metadata to Bos under the specified bucket and key name.PutObjectResponseputObject(String bucketName, String key, File file)Uploads the specified file to Bos under the specified bucket and key name.PutObjectResponseputObject(String bucketName, String key, File file, ObjectMetadata metadata)Uploads the specified file and object metadata to Bos under the specified bucket and key name.PutObjectResponseputObject(String bucketName, String key, InputStream input)Uploads the specified input stream to Bos under the specified bucket and key name.PutObjectResponseputObject(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.PutObjectResponseputObject(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.PutObjectResponseputObject(String bucketName, String key, String value)Uploads the specified string to Bos under the specified bucket and key name.PutObjectResponseputObject(String bucketName, String key, String value, ObjectMetadata metadata)Uploads the specified string and object metadata to Bos under the specified bucket and key name.booleanputSuperObjectFromFile(PutSuperObjectRequest putSuperObjectRequest)booleanputSuperObjectFromFile(File file, String bucketName, String objectKey)The Encapsulation of three-step upload when put Super Object from filebooleanputSuperObjectFromFile(File file, String bucketName, String objectKey, int nThreads)The Encapsulation of three-step upload when put Super Object from filebooleanputSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize)The Encapsulation of three-step upload when put Super Object from filebooleanputSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize, int nThreads)The Encapsulation of three-step upload when put Super Object from fileRenameObjectResponserenameObject(RenameObjectRequest request)renameObject support rename one object key to another.RenameObjectResponserenameObject(String bucketName, String sourceKey, String destinationKey)renameObject support rename one object key to anothervoidrestoreObject(RestoreObjectRequest request)Restore an archive object to the specified Bos bucketvoidrestoreObject(String bucketName, String key)Restore an archive object to the specified Bos bucketvoidrestoreObject(String bucketName, String key, int restoreDays, String restoreTier)Restore an archive object to the specified Bos bucketSelectObjectResponseselectObject(SelectObjectRequest request)voidsetBucketAcl(SetBucketAclRequest request)Sets the Acl for the specified Bos bucket.voidsetBucketAcl(String bucketName, CannedAccessControlList acl)Sets the CannedAccessControlList for the specified Bos bucket using one of the pre-configuredCannedAccessControlLists.voidsetBucketAcl(String bucketName, String jsonAcl)Sets the json style of bucket acl for the specified Bos bucket using one of the pre-configuredCannedAccessControlLists.voidsetBucketBucketLifecycle(SetBucketLifecycleRequest request)Sets the Lifecycle for the specified Bos bucket.voidsetBucketCopyrightProtection(SetBucketCopyrightProtectionRequest request)Set bucket CopyrightProtectionvoidsetBucketCopyrightProtection(String bucketName, List<String> resources)Set bucket CopyrightProtectionvoidsetBucketCors(SetBucketCorsRequest request)Sets the CORS for the specified Bos bucket.voidsetBucketEncryption(SetBucketEncryptionRequest request)Set bucket encryptionvoidsetBucketEncryption(String bucketName, BucketEncryption encryption)Set bucket encryptionvoidsetBucketLogging(SetBucketLoggingRequest request)Sets the Logging for the specified Bos bucket.voidsetBucketReplication(SetBucketReplicationRequest request)Sets the replication for the specified Bos bucket with specified replicationId.voidsetBucketStaticWebSite(SetBucketStaticWebsiteRequest request)Set bucket websitevoidsetBucketStaticWebSite(String bucketName, String index, String notfound)Set bucket websitevoidsetObjectAcl(SetObjectAclRequest request)Set Object Acl for specified object in the specified bucket.voidsetObjectAcl(String bucketName, String objectKey, CannedAccessControlList acl)Set Object Acl for specified object in the specified bucket.voidsetObjectAcl(String bucketName, String objectKey, String jsonObjectAcl)Set Object Acl for specified object in the specified bucket.SetObjectSymlinkResponsesetObjectSymlink(SetObjectSymlinkRequest request)Set the specified object symlink in the specified bucket.SetObjectSymlinkResponsesetObjectSymlink(String bucketName, String key, String symlinkTarget)Set the specified object symlink in the specified bucket.StateSummaryResponsestateSummary(StateSummaryRequest request)StateSummaryResponsestateSummary(String bucketName)StateSummaryResponsestateSummary(String bucketName, String prefix)booleanuploadFilePart(PutSuperObjectRequest putSuperObjectRequest, int partNum, List<PartETag> partETags)UploadPartResponseuploadPart(UploadPartRequest request)Uploads a part in a multipart upload.UploadPartCopyResponseuploadPartCopy(UploadPartCopyRequest request)Uploads a copy part in a multipart upload.-
从类继承的方法 com.baidubce.AbstractBceClient
computeBktVirEndpoint, computeServiceId, getBktVirEndpoint, getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
-
-
-
-
字段详细资料
-
STORAGE_CLASS_STANDARD
public static final String STORAGE_CLASS_STANDARD
Standard BOS storage class- 另请参阅:
- 常量字段值
-
STORAGE_CLASS_STANDARD_IA
public static final String STORAGE_CLASS_STANDARD_IA
Infrequent access BOS storage class- 另请参阅:
- 常量字段值
-
STORAGE_CLASS_COLD
public static final String STORAGE_CLASS_COLD
Cold access BOS storage class- 另请参阅:
- 常量字段值
-
STORAGE_CLASS_ARCHIVE
public static final String STORAGE_CLASS_ARCHIVE
Archive access BOS storage class- 另请参阅:
- 常量字段值
-
RESTORE_TIER_STANDARD
public static final String RESTORE_TIER_STANDARD
Standard restore tier- 另请参阅:
- 常量字段值
-
RESTORE_TIER_EXPEDITED
public static final String RESTORE_TIER_EXPEDITED
Expedited restore tier- 另请参阅:
- 常量字段值
-
-
构造器详细资料
-
BosClient
public BosClient()
Constructs a new client to invoke service methods on Bos.
-
BosClient
public BosClient(BosClientConfiguration clientConfiguration)
Constructs a new Bos client using the client configuration to access Bos.- 参数:
clientConfiguration- The bos client configuration options controlling how this client connects to Bos (e.g. proxy settings, retry counts, etc).
-
-
方法详细资料
-
getBosAccountOwner
public User getBosAccountOwner()
Gets the current owner of the Bos account that the authenticated sender of the request is using.The caller must authenticate with a valid BCE Access Key ID that is registered with Bos.
- 返回:
- The account of the authenticated sender
-
getBosAccountOwner
public User getBosAccountOwner(GetBosAccountOwnerRequest request)
Gets the current owner of the Bos account that the authenticated sender of the request is using.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.- 返回:
- The account of the authenticated sender
-
listBuckets
public ListBucketsResponse listBuckets()
Returns a list of all Bos buckets that the authenticated sender of the request owns.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.
- 返回:
- All of the Bos buckets owned by the authenticated sender of the request.
-
listBuckets
public ListBucketsResponse listBuckets(ListBucketsRequest request)
Returns a list of all Bos buckets that the authenticated sender of the request owns.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.- 返回:
- All of the Bos buckets owned by the authenticated sender of the request.
-
createBucket
public CreateBucketResponse createBucket(String bucketName)
Creates a new Bos bucket with the specified name.- 参数:
bucketName- The name of the bucket to create. All buckets in Bos share a single namespace; ensure the bucket is given a unique name.- 返回:
- The newly created bucket.
-
createBucket
public CreateBucketResponse createBucket(CreateBucketRequest request)
Creates a new Bos bucket with the specified name.- 参数:
request- The request object containing all options for creating a Bos bucket.- 返回:
- The newly created bucket.
-
doesBucketExist
public boolean doesBucketExist(String bucketName)
Checks if the specified bucket exists. Bos buckets are named in a global namespace; use this method to determine if a specified bucket name already exists, and therefore can't be used to create a new bucket.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.- 返回:
- The value
trueif the specified bucket exists in Bos; the valuefalseif there is no bucket in Bos with that name.
-
doesBucketExist
public boolean doesBucketExist(DoesBucketExistRequest request)
Checks if the specified bucket exists. Bos buckets are named in a global namespace; use this method to determine if a specified bucket name already exists, and therefore can't be used to create a new bucket.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.- 返回:
- The value
trueif the specified bucket exists in Bos; the valuefalseif there is no bucket in Bos with that name.
-
getBucketAcl
public GetBucketAclResponse getBucketAcl(String bucketName)
Gets the ACL for the specified Bos bucket.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.- 返回:
- The
GetBuckeetAclResponsefor the specified Bos bucket.
-
getBucketAcl
public GetBucketAclResponse getBucketAcl(GetBucketAclRequest request)
Gets the ACL for the specified Bos bucket.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.- 返回:
- The
GetBuckeetAclResponsefor the specified Bos bucket.
-
getBucketLocation
public GetBucketLocationResponse getBucketLocation(String bucketName)
Gets the Location for the specified Bos bucket.Each bucket and object in Bos has an Location that defines its location
- 参数:
bucketName- The name of the bucket whose Location is being retrieved.- 返回:
- The
GetBuckeetLocationResponsefor the specified Bos bucket.
-
getBucketLocation
public GetBucketLocationResponse getBucketLocation(GetBucketLocationRequest request)
Gets the Location for the specified Bos bucket.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.- 返回:
- The
GetBuckeetLocationResponsefor the specified Bos bucket.
-
putBucketStorageClass
public void putBucketStorageClass(String bucketName, String storageClass)
Sets the default storageClass for the specified Bos bucket.A
json style of bucket storageClassprovides 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.
-
putBucketStorageClass
public void putBucketStorageClass(PutBucketStorageClassRequest request)
Sets the default storageClass for the specified Bos bucket.A
json style of bucket storageClassprovides a storageClass to configure an bucket.- 参数:
request- The request containing the name of the bucket and the default storageClass.
-
getBucketStorageClass
public GetBucketStorageClassResponse getBucketStorageClass(String bucketName)
Gets the default storageClass for the specified Bos bucket.- 参数:
bucketName- The bucket whose storageClass to to get.
-
getBucketStorageClass
public GetBucketStorageClassResponse getBucketStorageClass(GetBucketStorageClassRequest request)
Gets the default storageClass for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to get bucket logging.
-
setBucketAcl
public void setBucketAcl(String bucketName, String jsonAcl)
Sets the json style of bucket acl for the specified Bos bucket using one of the pre-configuredCannedAccessControlLists.A
json style of bucket aclprovides 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-configuredCannedAccessControlListsto set for the specified bucket.
-
setBucketAcl
public void setBucketAcl(String bucketName, CannedAccessControlList acl)
Sets the CannedAccessControlList for the specified Bos bucket using one of the pre-configuredCannedAccessControlLists.A
CannedAccessControlListprovides 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-configuredCannedAccessControlListsto set for the specified bucket.
-
setBucketAcl
public void setBucketAcl(SetBucketAclRequest request)
Sets the Acl for the specified Bos bucket.- 参数:
request- The request object containing the bucket to modify and the ACL to set.
-
setBucketLogging
public void setBucketLogging(SetBucketLoggingRequest request)
Sets the Logging for the specified Bos bucket.- 参数:
request- The request object containing the Logging to set into specified bucket.
-
getBucketLogging
public GetBucketLoggingResponse getBucketLogging(GetBucketLoggingRequest request)
Gets the Logging for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to get bucket logging.
-
deleteBucketLogging
public void deleteBucketLogging(DeleteBucketLoggingRequest request)
Delete the Logging for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to delete bucket logging.
-
setBucketCors
public void setBucketCors(SetBucketCorsRequest request)
Sets the CORS for the specified Bos bucket.- 参数:
request- The request object containing the CORS to set into specified bucket.
-
getBucketCros
public GetBucketCorsResponse getBucketCros(GetBucketCorsRequest request)
Gets the CORS for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to get bucket CORS.
-
deleteBucketCors
public void deleteBucketCors(DeleteBucketCorsRequest request)
Delete the CORS for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to delete bucket CORS.
-
setBucketReplication
public void setBucketReplication(SetBucketReplicationRequest request)
Sets the replication for the specified Bos bucket with specified replicationId.- 参数:
request-
-
getBucketReplication
public GetBucketReplicationResponse getBucketReplication(GetBucketReplicationRequest request)
Gets the replication for the specified Bos bucket with specified replicationId.
-
deleteBucketReplication
public void deleteBucketReplication(DeleteBucketReplicationRequest request)
Deletes the replication for the specified Bos bucket with specified replicationId.
-
getBucketReplicationProgress
public BucketReplicationProgress getBucketReplicationProgress(GetBucketReplicationProgressRequest request)
Gets the bucket replication progress for the specified Bos bucket with specified replicationId
-
listBucketReplication
public ListBucketReplicationResponse listBucketReplication(ListBucketReplicationRequest request)
List all bucket replication
-
setBucketBucketLifecycle
public void setBucketBucketLifecycle(SetBucketLifecycleRequest request)
Sets the Lifecycle for the specified Bos bucket.- 参数:
request- The request object containing the Lifecycle to set into specified bucket.
-
getBucketLifecycle
public GetBucketLifecycleResponse getBucketLifecycle(GetBucketLifecycleRequest request)
Gets Lifecycle for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to get bucket Lifecycle.
-
deleteBucketLifecycle
public void deleteBucketLifecycle(DeleteBucketLifecycleRequest request)
Delete the Lifecycle for the specified Bos bucket.- 参数:
request- The request object containing the specified bucket to delete bucket Lifecycle.
-
deleteBucket
public void deleteBucket(String bucketName)
Deletes the specified bucket. All objects 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.
- 参数:
bucketName- The name of the bucket to delete.
-
deleteBucket
public void deleteBucket(DeleteBucketRequest request)
Deletes the specified bucket. All objects 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.
- 参数:
request- The request object containing all options for deleting a Bos bucket.
-
generatePresignedUrl
public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds)
Returns a pre-signed URL for accessing a Bos resource.- 参数:
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.- 返回:
- A pre-signed URL which expires at the specified time, and can be used to allow anyone to download the specified object from Bos, without exposing the owner's Bce secret access key.
-
generatePresignedUrl
public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds, HttpMethodName method)
Returns a pre-signed URL for accessing a Bos resource.- 参数:
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 URL- 返回:
- A pre-signed URL which expires at the specified time, and can be used to allow anyone to download the specified object from Bos, without exposing the owner's Bce secret access key.
-
generatePresignedUrl
public URL generatePresignedUrl(GeneratePresignedUrlRequest request)
Returns a pre-signed URL for accessing a Bos resource.- 参数:
request- The request object containing all the options for generating a pre-signed URL (bucket name, key, expiration date, etc).- 返回:
- A pre-signed URL which expires at the specified time, and can be used to allow anyone to download the specified object from Bos, without exposing the owner's Bce secret access key.
-
listObjects
public ListObjectsResponse listObjects(String bucketName)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets. List results are always returned in lexicographic (alphabetical) order.- 参数:
bucketName- The name of the Bos bucket to list.- 返回:
- ListObjectsResponse containing a listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
-
listObjects
public ListObjectsResponse listObjects(String bucketName, String prefix)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets. List results are always returned in lexicographic (alphabetical) order.- 参数:
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.- 返回:
- ListObjectsResponse containing a listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
-
listObjects
public ListObjectsResponse listObjects(ListObjectsRequest request)
Returns ListObjectsResponse containing a list of summary information about the objects in the specified buckets. List results are always returned in lexicographic (alphabetical) order.- 参数:
request- The request object containing all options for listing the objects in a specified bucket.- 返回:
- ListObjectsResponse containing a listing of the objects in the specified bucket, along with any other associated information, such as common prefixes (if a delimiter was specified), the original request parameters, etc.
-
listNextBatchOfObjects
public ListObjectsResponse listNextBatchOfObjects(ListObjectsResponse previousResponse)
Provides an easy way to continue a truncated object listing and retrieve the next page of results.- 参数:
previousResponse- The previous truncatedListObjectsResponse. If a non-truncatedListObjectsResponseis passed in, an emptyListObjectsResponseis returned without ever contacting Bos.- 返回:
- The next set of
ListObjectsResponseresults, beginning immediately after the last result in the specified previousListObjectsResponse.
-
getObject
public BosObject getObject(String bucketName, String key)
Gets the object stored in Bos under the specified bucket and key.- 参数:
bucketName- The name of the bucket containing the desired object.key- The key under which the desired object is stored.- 返回:
- The object stored in Bos in the specified bucket and key.
-
getObject
public 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. Returnsnullif 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.- 返回:
- All Bos object metadata for the specified object.
Returns
nullif constraints were specified but not met.
-
getObject
public BosObject getObject(GetObjectRequest request)
Gets the object stored in Bos under the specified bucket and key.- 参数:
request- The request object containing all the options on how to download the object.- 返回:
- The object stored in Bos in the specified bucket and key.
-
getObject
public 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. Returnsnullif 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.- 返回:
- All Bos object metadata for the specified object.
Returns
nullif constraints were specified but not met.
-
getObjectContent
public byte[] getObjectContent(String bucketName, String key)
Gets the object content stored in Bos under the specified bucket and key.- 参数:
bucketName- The name of the bucket containing the desired object.key- The key under which the desired object is stored.- 返回:
- The object content stored in Bos in the specified bucket and key.
-
getObjectContent
public byte[] getObjectContent(GetObjectRequest request)
Gets the object content stored in Bos under the specified bucket and key.- 参数:
request- The request object containing all the options on how to download the Bos object content.- 返回:
- The object content stored in Bos in the specified bucket and key.
-
doesObjectExist
public boolean doesObjectExist(String bucketName, String key)
Checks if the specified object exists. use this method to determine if a specified object already existsIf 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.- 返回:
- The value
trueif the specified object exists in Bos; the valuefalseif there is no object in Bos with that name.
-
getObjectMetadata
public ObjectMetadata getObjectMetadata(String bucketName, String key)
Gets the metadata for the specified Bos 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 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.- 返回:
- All Bos object metadata for the specified object.
-
getObjectMetadata
public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest request)
Gets the metadata for the specified Bos 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 Bos.
- 参数:
request- The request object specifying the bucket, key whose metadata is being retrieved.- 返回:
- All Bos object metadata for the specified object.
-
putObject
public PutObjectResponse putObject(String bucketName, String key, File file)
Uploads the specified file to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public 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.- 参数:
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.).- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public PutObjectResponse putObject(String bucketName, String key, String value)
Uploads the specified string to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public 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.- 参数:
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.).- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public PutObjectResponse putObject(String bucketName, String key, byte[] value)
Uploads the specified bytes to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public 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.- 参数:
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.).- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public PutObjectResponse putObject(String bucketName, String key, InputStream input)
Uploads the specified input stream to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public 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.- 参数:
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.).- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public 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.- 参数:
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.).- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
putObject
public PutObjectResponse putObject(PutObjectRequest request)
Uploads a new object to the specified Bos bucket. ThePutObjectRequestcontains 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.- 返回:
- A PutObjectResponse object containing the information returned by Bos for the newly created object.
-
copyObject
public CopyObjectResponse copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey)
Copies a source object to a new destination in Bos.- 参数:
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.- 返回:
- A CopyObjectResponse object containing the information returned by Bos for the newly created object.
-
copyObject
public CopyObjectResponse copyObject(CopyObjectRequest request)
Copies a source object to a new destination in Bos.- 参数:
request- The request object containing all the options for copying an Bos object.- 返回:
- A CopyObjectResponse object containing the information returned by Bos for the newly created object.
-
fetchObject
public FetchObjectResponse fetchObject(String bucketName, String key, String sourceUrl)
Fetches a source object to a new destination in Bos.- 参数:
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.- 返回:
- A FetchObjectResponse object containing the information returned by Bos for the newly fetching.
-
fetchObject
public FetchObjectResponse fetchObject(String bucketName, String key, String sourceUrl, String mode)
Fetches a source object to a new destination in Bos.- 参数:
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.- 返回:
- A FetchObjectResponse object containing the information returned by Bos for the newly fetching.
-
fetchObject
public FetchObjectResponse fetchObject(FetchObjectRequest request)
Fetches a source object to a new destination in Bos.- 参数:
request- The request object containing all the options for fetching url to a Bos object.- 返回:
- A FetchObjectResponse object containing the information returned by Bos for the newly fetching.
-
deleteObject
public void deleteObject(String bucketName, String key)
Deletes the specified object in the specified bucket.- 参数:
bucketName- The name of the Bos bucket containing the object to delete.key- The key of the object to delete.
-
deleteObject
public void deleteObject(DeleteObjectRequest request)
Deletes the specified object in the specified bucket.- 参数:
request- The request object containing all options for deleting a Bos object.
-
setObjectSymlink
public SetObjectSymlinkResponse setObjectSymlink(String bucketName, String key, String symlinkTarget)
Set the specified object symlink in the specified bucket.- 参数:
bucketName- The name of the Bos bucket containing the objectkey- The object's symlink namesymlinkTarget- The target object of the symlink- 返回:
-
setObjectSymlink
public SetObjectSymlinkResponse setObjectSymlink(SetObjectSymlinkRequest request)
Set the specified object symlink in the specified bucket.- 参数:
request- The request object containing all options for setting a symlink of target object.- 返回:
-
getObjectSymlink
public GetObjectSymlinkResponse getObjectSymlink(String bucketName, String key)
Gets the specified object symlink in the specified bucket- 参数:
bucketName- The name of the Bos bucket containing the symlink objectkey- The symlink name- 返回:
- The symlink target Object
-
getObjectSymlink
public GetObjectSymlinkResponse getObjectSymlink(GetObjectSymlinkRequest request)
Gets the specified object symlink in the specified bucket- 参数:
request- The request object containing all options for getting a symlink of target object.- 返回:
- The symlink target Object
-
deleteMultipleObjects
public DeleteMultipleObjectsResponse deleteMultipleObjects(DeleteMultipleObjectsRequest request)
Deletes the multiple specified objects in the specified bucket.- 参数:
request- The request object containing all options for deleting a Bos multiple objects.
-
setObjectAcl
public void setObjectAcl(String bucketName, String objectKey, String jsonObjectAcl)
Set Object Acl for specified object in the specified bucket.- 参数:
bucketName-objectKey-jsonObjectAcl- The json format of specified object.
-
setObjectAcl
public void setObjectAcl(String bucketName, String objectKey, CannedAccessControlList acl)
Set Object Acl for specified object in the specified bucket.- 参数:
bucketName-objectKey-acl- The CannedAccessControlList of specified object.
-
setObjectAcl
public void setObjectAcl(SetObjectAclRequest request)
Set Object Acl for specified object in the specified bucket.- 参数:
request- The request object containing all options for setting a Bos object acl.
-
getObjectAcl
public GetObjectAclResponse getObjectAcl(GetObjectAclRequest request)
Get Object Acl for specified object in the specified bucket.- 参数:
request- The request object containing all options for getting a Bos object acl.
-
deleteObjectAcl
public void deleteObjectAcl(DeleteObjectAclRequest request)
Delete Object Acl for specified object in the specified bucket.- 参数:
request- The request object containing all options for deleting a Bos object acl.
-
initiateMultipartUpload
public InitiateMultipartUploadResponse initiateMultipartUpload(String bucketName, String key)
Initiates a multipart upload and returns an InitiateMultipartUploadResponse which contains an upload ID. This upload ID associates all the parts in the specific upload and is used in each of your subsequent uploadPart requests. You also include this upload ID in the final request to either complete, or abort the multipart upload request.- 参数:
bucketName- The name of the Bos bucket containing the object to initiate.key- The key of the object to initiate.- 返回:
- An InitiateMultipartUploadResponse from Bos.
-
initiateMultipartUpload
public InitiateMultipartUploadResponse initiateMultipartUpload(InitiateMultipartUploadRequest request)
Initiates a multipart upload and returns an InitiateMultipartUploadResponse which contains an upload ID. This upload ID associates all the parts in the specific upload and is used in each of your subsequent uploadPart requests. You also include this upload ID in the final request to either complete, or abort the multipart upload request.- 参数:
request- The InitiateMultipartUploadRequest object that specifies all the parameters of this operation.- 返回:
- An InitiateMultipartUploadResponse from Bos.
-
uploadPart
public UploadPartResponse uploadPart(UploadPartRequest request)
Uploads a part in a multipart upload. You must initiate a multipart upload before you can upload any part.- 参数:
request- The UploadPartRequest object that specifies all the parameters of this operation.- 返回:
- An UploadPartResponse from Bos containing the part number and ETag of the new part.
-
uploadPartCopy
public UploadPartCopyResponse uploadPartCopy(UploadPartCopyRequest request)
Uploads a copy part in a multipart upload. You must initiate a multipart upload before you can upload any part.- 参数:
request- The UploadPartCopyRequest object that specifies all the parameters of this operation.- 返回:
- An UploadPartCopyResponse from Bos containing the part number and ETag of the new part.
-
listParts
public ListPartsResponse listParts(String bucketName, String key, String uploadId)
Lists the parts that have been uploaded for a specific multipart upload.- 参数:
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.- 返回:
- Returns a ListPartsResponse from Bos.
-
listParts
public ListPartsResponse listParts(ListPartsRequest request)
Lists the parts that have been uploaded for a specific multipart upload.- 参数:
request- The ListPartsRequest object that specifies all the parameters of this operation.- 返回:
- Returns a ListPartsResponse from Bos.
-
completeMultipartUpload
public CompleteMultipartUploadResponse completeMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags)
Completes a multipart upload by assembling previously uploaded parts.- 参数:
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.- 返回:
- A CompleteMultipartUploadResponse from Bos containing the ETag for the new object composed of the individual parts.
-
completeMultipartUpload
public CompleteMultipartUploadResponse completeMultipartUpload(String bucketName, String key, String uploadId, List<PartETag> partETags, ObjectMetadata metadata)
Completes a multipart upload by assembling previously uploaded parts.- 参数:
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.).- 返回:
- A CompleteMultipartUploadResponse from Bos containing the ETag for the new object composed of the individual parts.
-
completeMultipartUpload
public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request)
Completes a multipart upload by assembling previously uploaded parts.- 参数:
request- The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.- 返回:
- A CompleteMultipartUploadResponse from Bos containing the ETag for the new object composed of the individual parts.
-
abortMultipartUpload
public void abortMultipartUpload(String bucketName, String key, String uploadId)
Aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads may or may not succeed. As a result, it may be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts.- 参数:
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.
-
abortMultipartUpload
public void abortMultipartUpload(AbortMultipartUploadRequest request)
Aborts a multipart upload. After a multipart upload is aborted, no additional parts can be uploaded using that upload ID. The storage consumed by any previously uploaded parts will be freed. However, if any part uploads are currently in progress, those part uploads may or may not succeed. As a result, it may be necessary to abort a given multipart upload multiple times in order to completely free all storage consumed by all parts.- 参数:
request- The AbortMultipartUploadRequest object that specifies all the parameters of this operation.
-
listMultipartUploads
public ListMultipartUploadsResponse listMultipartUploads(String bucketName)
Lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that has been initiated, using the InitiateMultipartUpload request, but has not yet been completed or aborted.- 参数:
bucketName- The name of the bucket containing the uploads to list.- 返回:
- A ListMultipartUploadsResponse from Bos.
-
listMultipartUploads
public ListMultipartUploadsResponse listMultipartUploads(ListMultipartUploadsRequest request)
Lists in-progress multipart uploads. An in-progress multipart upload is a multipart upload that has been initiated, using the InitiateMultipartUpload request, but has not yet been completed or aborted.- 参数:
request- The ListMultipartUploadsRequest object that specifies all the parameters of this operation.- 返回:
- A ListMultipartUploadsResponse from Bos.
-
appendObject
public AppendObjectResponse appendObject(String bucketName, String key, File file)
Uploads the specified appendable file to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public AppendObjectResponse appendObject(String bucketName, String key, File file, ObjectMetadata metadata)
Uploads the specified appendable file to Bos under the specified bucket and key name.- 参数:
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.).- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public AppendObjectResponse appendObject(String bucketName, String key, String value)
Uploads the specified string to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public 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.- 参数:
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.).- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public AppendObjectResponse appendObject(String bucketName, String key, byte[] value)
Uploads the specified bytes to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public 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.- 参数:
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.).- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public AppendObjectResponse appendObject(String bucketName, String key, InputStream input)
Uploads the appendable input stream to Bos under the specified bucket and key name.- 参数:
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.- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public 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.- 参数:
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.).- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
appendObject
public AppendObjectResponse appendObject(AppendObjectRequest request)
Uploads a new object to the specified Bos bucket. TheAppendObjectRequestcontains 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.- 返回:
- An AppendObjectResponse object containing the information returned by Bos for the newly created object.
-
restoreObject
public void restoreObject(String bucketName, String key)
Restore an archive object to the specified Bos bucket- 参数:
bucketName- The name of rsestore an archive object.key- The key of rsestore an archive object.
-
restoreObject
public void restoreObject(String bucketName, String key, int restoreDays, String restoreTier)
Restore an archive object to the specified Bos bucket- 参数:
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.
-
restoreObject
public void restoreObject(RestoreObjectRequest request)
Restore an archive object to the specified Bos bucket- 参数:
request- The request object containing all the parameters to restore an archive object
-
setBucketEncryption
public void setBucketEncryption(String bucketName, BucketEncryption encryption)
Set bucket encryption- 参数:
bucketName- The name of an existing bucket, to which you have Write permission.encryption- The encryption of bucket
-
setBucketEncryption
public void setBucketEncryption(SetBucketEncryptionRequest request)
Set bucket encryption
-
getBucketEncryption
public GetBucketEncryptionResponse getBucketEncryption(String bucketName)
Get Bucket Encryption- 参数:
bucketName- The name of an existing bucket- 返回:
-
getBucketEncryption
public GetBucketEncryptionResponse getBucketEncryption(GetBucketEncryptionRequest request)
Get Bucket Encryption- 参数:
request-- 返回:
-
deleteBucketEncryption
public void deleteBucketEncryption(String bucketName)
Delete Bucket Encryption- 参数:
bucketName- The name of an existing bucket, to which you have Write permission.
-
deleteBucketEncryption
public void deleteBucketEncryption(DeleteBucketEncryptionRequest request)
Delete Bucket Encryption- 参数:
request-
-
setBucketStaticWebSite
public void setBucketStaticWebSite(String bucketName, String index, String notfound)
Set bucket website- 参数:
bucketName- The name of an existing bucket, to which you have Write permission.index- The index page for staticwebsitenotfound- The notFound page for staticwebsite
-
setBucketStaticWebSite
public void setBucketStaticWebSite(SetBucketStaticWebsiteRequest request)
Set bucket website- 参数:
request-
-
getBucketStaticWebsite
public GetBucketStaticWebsiteResponse getBucketStaticWebsite(String bucketName)
Get bucket static website- 参数:
bucketName- The name of an existing bucket, to which you have Read permission.- 返回:
-
getBucketStaticWebsite
public GetBucketStaticWebsiteResponse getBucketStaticWebsite(GetBucketStaticWebsiteRequest request)
Get bucket static website- 参数:
request-- 返回:
-
deleteBucketStaticWebSite
public void deleteBucketStaticWebSite(String bucketName)
Delete bucket static website- 参数:
bucketName- The name of an existing bucket, to which you have Write permission.
-
deleteBucketStaticWebSite
public void deleteBucketStaticWebSite(DeleteBucketStaticWebsiteRequest request)
Delete bucket static website- 参数:
request-
-
setBucketCopyrightProtection
public void setBucketCopyrightProtection(String bucketName, List<String> resources)
Set bucket CopyrightProtection- 参数:
bucketName- The name of an existing bucket, to which you have Write permissionresources- The resourceList of Bucket CopyrightProtection
-
setBucketCopyrightProtection
public void setBucketCopyrightProtection(SetBucketCopyrightProtectionRequest request)
Set bucket CopyrightProtection
-
getBucketCopyrightProtection
public GetBucketCopyrightProtectionResponse getBucketCopyrightProtection(String bucketName)
Get bucket copyrightprotection- 参数:
bucketName- The name of an existing bucket, to which you have Read permission- 返回:
-
getBucketCopyrightProtection
public GetBucketCopyrightProtectionResponse getBucketCopyrightProtection(GetBucketCopyrightProtectionRequest request)
Get bucket copyrightprotection- 参数:
request-- 返回:
-
deleteBucketCopyrightProtection
public void deleteBucketCopyrightProtection(String bucketName)
Delete Bucket copyrightprotection- 参数:
bucketName- The name of an existing bucket, to which you have Write permission
-
deleteBucketCopyrightProtection
public void deleteBucketCopyrightProtection(DeleteBucketCopyrightProtectionRequest request)
Delete Bucket copyrightprotection- 参数:
request-
-
putSuperObjectFromFile
public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey)
The Encapsulation of three-step upload when put Super Object from file- 参数:
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.- 返回:
-
putSuperObjectFromFile
public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize)
The Encapsulation of three-step upload when put Super Object from file- 参数:
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 file- 返回:
-
putSuperObjectFromFile
public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, int nThreads)
The Encapsulation of three-step upload when put Super Object from file- 参数:
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 pool- 返回:
-
putSuperObjectFromFile
public boolean putSuperObjectFromFile(File file, String bucketName, String objectKey, long chunksize, int nThreads)
The Encapsulation of three-step upload when put Super Object from file- 参数:
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 pool- 返回:
-
putSuperObjectFromFile
public boolean putSuperObjectFromFile(PutSuperObjectRequest putSuperObjectRequest)
-
uploadFilePart
public boolean uploadFilePart(PutSuperObjectRequest putSuperObjectRequest, int partNum, List<PartETag> partETags)
-
selectObject
public SelectObjectResponse selectObject(SelectObjectRequest request)
-
stateSummary
public StateSummaryResponse stateSummary(String bucketName)
-
stateSummary
public StateSummaryResponse stateSummary(String bucketName, String prefix)
-
stateSummary
public StateSummaryResponse stateSummary(StateSummaryRequest request)
-
headBucket
public HeadBucketResponse headBucket(String bucketName)
Gets the res whether the bucket exists, bucket type- 参数:
bucketName- The name of the checked bucket- 返回:
- The
HeadBucketResponsefor the specified Bos bucket.
-
headBucket
public HeadBucketResponse headBucket(HeadBucketRequest request)
Gets the res whether the bucket exists, bucket type- 参数:
request- containing the name the checked bucket- 返回:
- The
HeadBucketResponsefor the specified Bos bucket.
-
getBucketMirroring
public GetBucketMirroringResponse getBucketMirroring(String bucketName)
Gets the Bos bucket mirroring description.- 参数:
bucketName- The name of an existing bucket, to which you have permission- 返回:
- The
GetBucketMirroringResponsefor the Bos bucket.
-
getBucketMirroring
public GetBucketMirroringResponse getBucketMirroring(GetBucketMirroringRequest request)
Gets the Bos bucket mirroring description.- 参数:
request- The GetBucketMirroringRequest you create- 返回:
- The
GetBucketMirroringResponsefor the Bos bucket.
-
putBucketMirroring
public void putBucketMirroring(String bucketName, List<BucketMirroringConfiguration> bucketMirroringConfigurations)
Set the Bos bucket mirroring.- 参数:
bucketName- The name of an existing bucket, to which you have permissionbucketMirroringConfigurations- The bucketMirroringConfigurations object that your create
-
putBucketMirroring
public void putBucketMirroring(String bucketName, String jsonBucketMirroringConfigurations)
Set the Bos bucket mirroring.- 参数:
bucketName- The name of an existing bucket, to which you have permissionjsonBucketMirroringConfigurations- The bucketMirroringConfigurations json string that your create
-
putBucketMirroring
public void putBucketMirroring(PutBucketMirroringRequest request)
Set the Bos bucket mirroring.- 参数:
request- The PutBucketMirroringRequest you create
-
deleteBucketMirroring
public void deleteBucketMirroring(String bucketName)
Delete the Bos bucket mirroring setting.- 参数:
bucketName- The name of an existing bucket, to which you have permission
-
deleteBucketMirroring
public void deleteBucketMirroring(DeleteBucketMirroringRequest request)
Delete the Bos bucket mirroring setting.- 参数:
request- The DeleteBucketMirroringRequest you create
-
getBucketTagging
public GetBucketTaggingResponse getBucketTagging(String bucketName)
Gets the Bos bucket tagging description.- 参数:
bucketName- The name of an existing bucket, to which you have permission- 返回:
- The
GetBucketTaggingResponsefor the Bos bucket.
-
getBucketTagging
public GetBucketTaggingResponse getBucketTagging(GetBucketTaggingRequest request)
Gets the Bos bucket tagging description.- 参数:
request- The GetBucketTaggingRequest you create- 返回:
- The
GetBucketTaggingResponsefor the Bos bucket.
-
deleteBucketTagging
public void deleteBucketTagging(String bucketName)
Delete the Bos bucket tagging setting.- 参数:
bucketName- The name of an existing bucket, to which you have permission
-
deleteBucketTagging
public void deleteBucketTagging(DeleteBucketTaggingRequest request)
Delete the Bos bucket tagging setting.- 参数:
request- The DeleteBucketTaggingRequest you create
-
putBucketTagging
public void putBucketTagging(String bucketName, String jsonBucketTags)
Set the Bos bucket tagging.- 参数:
bucketName- The name of an existing bucket, to which you have permissionjsonBucketTags- The bucket tagging json string that your create
-
putBucketTagging
public void putBucketTagging(String bucketName, List<BucketTag> tags)
Set the Bos bucket tagging.- 参数:
bucketName- The name of an existing bucket, to which you have permissiontags- The bucket tagging object that your create
-
putBucketTagging
public void putBucketTagging(PutBucketTaggingRequest request)
Set the Bos bucket tagging.- 参数:
request- The PutBucketTaggingRequest you create
-
putBucketTrash
public void putBucketTrash(String bucketName, String trashDir)
Set the Bos bucket trash.- 参数:
bucketName- The name of an existing bucket, to which you have permissiontrashDir- The bucket trash name that your want to create
-
putBucketTrash
public void putBucketTrash(String bucketName)
Set the Bos bucket trash.- 参数:
bucketName- The name of an existing bucket, to which you have permission
-
putBucketTrash
public void putBucketTrash(PutBucketTrashRequest request)
Set the Bos bucket trash.- 参数:
request- The PutBucketTrashRequest you create
-
getBucketTrash
public GetBucketTrashResponse getBucketTrash(String bucketName)
Get the Bos bucket trash.- 参数:
bucketName- The name of an existing bucket, to which you have permission
-
getBucketTrash
public GetBucketTrashResponse getBucketTrash(GetBucketTrashRequest request)
Get the Bos bucket trash.- 参数:
request- The GetBucketTrashRequest you create
-
deleteBucketTrash
public void deleteBucketTrash(String bucketName)
Delete the Bos bucket trash.- 参数:
bucketName- The name of an existing bucket, to which you have permission
-
deleteBucketTrash
public void deleteBucketTrash(DeleteBucketTrashRequest request)
Delete the Bos bucket trash.- 参数:
request- The DeleteBucketTrashRequest you create
-
renameObject
public RenameObjectResponse renameObject(String bucketName, String sourceKey, String destinationKey)
renameObject support rename one object key to another- 参数:
bucketName- The name of an existing bucket, to which you have Write permission.sourceKey- The origin key of objectdestinationKey- The destination key of object- 返回:
- An RenameObjectResponse containing the information returned by Bos for rename operation
-
renameObject
public RenameObjectResponse renameObject(RenameObjectRequest request)
renameObject support rename one object key to another. TheARenameObjectRequestcontains all the details of the request, including the source key and destination key- 参数:
request- The request object containing all the parameters to rename object- 返回:
- An RenameObjectResponse object containing the information returned by Bos for for rename operation
-
-