设置Bucket存储类型
更新时间:2022-09-14
新建的Bucket默认是标准存储类型,用户也可以通过如下代码设置或获取指定Bucket的存储类型:
参数 | 说明 |
---|---|
storageClass | 存储类型,支持"STANDARD"、"STANDARD_IA"、"COLD"、"ARCHIVE" |
public void PutBucketStorageClass() {
// 设置"STANDARD_IA",低频存储
String storageClass = STORAGE_CLASS_STANDARD_IA;
this.client.putBucketStorageClass(this.bucketName, storageClass);
}
public String GetBucketStorageClass() {
GetBucketStorageClassResponse response = this.client.getBucketStorageClass(this.bucketName);
return response.getStorageClass();
}