API | 操作名 | 操作描述 |
设置版本控制 | 设置存储桶的版本控制功能 | |
查询版本控制 | 查询存储桶的版本控制信息 |
public void setBucketVersioningConfiguration(SetBucketVersioningConfigurationRequest setBucketVersioningConfigurationRequest)throws CosClientException, CosServiceException;
参数名称 | 描述 | 类型 |
setBucketVersioningConfigurationRequest | 版本控制配置 | SetBucketVersioningConfigurationRequest |
String bucketName = "examplebucket-1250000000";// 开启版本控制cosClient.setBucketVersioningConfiguration(new SetBucketVersioningConfigurationRequest(bucketName,new BucketVersioningConfiguration(BucketVersioningConfiguration.ENABLED)));
String bucketName = "examplebucket-1250000000";// 暂停版本控制cosClient.setBucketVersioningConfiguration(new SetBucketVersioningConfigurationRequest(bucketName,new BucketVersioningConfiguration(BucketVersioningConfiguration.SUSPENDED)));
// 方法1 传入存储桶名称即可public BucketVersioningConfiguration getBucketVersioningConfiguration(String bucketName)throws CosClientException, CosServiceException;// 方法2 通过GetBucketVersioningConfigurationRequest 获取public BucketVersioningConfiguration getBucketVersioningConfiguration(GetBucketVersioningConfigurationRequest getBucketVersioningConfigurationRequest)throws CosClientException, CosServiceException;
String bucketName = "examplebucket-1250000000";// 获取版本控制BucketVersioningConfiguration bvc =cosClient.getBucketVersioningConfiguration(bucketName);// 获取版本控制BucketVersioningConfiguration bvc2 = cosClient.getBucketVersioningConfiguration(new GetBucketVersioningConfigurationRequest(bucketName));
参数名称 | 描述 | 类型 |
bucketName | 存储桶的命名格式为 BucketName-APPID,详情请参见 命名规范 | String |
getBucketVersioningConfigurationRequest | 获取版本控制配置请求 | GetBucketVersioningConfigurationRequest |
本页内容是否解决了您的问题?