Package com.qiniu.storage
Class BucketManager.BatchOperations
- java.lang.Object
-
- com.qiniu.storage.BucketManager.BatchOperations
-
- Enclosing class:
- BucketManager
public static class BucketManager.BatchOperations extends java.lang.Object文件管理批量操作指令构建对象,单次 BatchOperations 的操作数最多为 1000(即 add 最多 1000 个),如果遇到超时,需要调小操作数量
-
-
Constructor Summary
Constructors Constructor Description BatchOperations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketManager.BatchOperationsaddChangeStatusOps(java.lang.String bucket, int status, java.lang.String... keys)添加 changeStatus 指令BucketManager.BatchOperationsaddChangeTypeOps(java.lang.String bucket, StorageType type, java.lang.String... keys)添加changeType指令BucketManager.BatchOperationsaddChgmOp(java.lang.String bucket, java.lang.String key, java.lang.String newMimeType)添加chgm指令BucketManager.BatchOperationsaddCopyOp(java.lang.String fromBucket, java.lang.String fromFileKey, java.lang.String toBucket, java.lang.String toFileKey)添加 copy 指令BucketManager.BatchOperationsaddDeleteAfterDaysOps(java.lang.String bucket, int days, java.lang.String... keys)添加 deleteAfterDays 指令BucketManager.BatchOperationsaddDeleteOp(java.lang.String bucket, java.lang.String... keys)添加delete指令BucketManager.BatchOperationsaddMoveOp(java.lang.String fromBucket, java.lang.String fromKey, java.lang.String toBucket, java.lang.String toKey)添加move指令BucketManager.BatchOperationsaddRenameOp(java.lang.String fromBucket, java.lang.String fromFileKey, java.lang.String toFileKey)添加重命名指令BucketManager.BatchOperationsaddRestoreArchiveOps(java.lang.String bucket, int freezeAfterDays, java.lang.String... keys)添加解冻归档存储指令BucketManager.BatchOperationsaddStatOps(java.lang.String bucket, java.lang.String... keys)添加stat指令BucketManager.BatchOperationsclearOps()java.lang.StringexecBucket()BucketManager.BatchOperationsmerge(BucketManager.BatchOperations batch)byte[]toBody()
-
-
-
Method Detail
-
addChgmOp
public BucketManager.BatchOperations addChgmOp(java.lang.String bucket, java.lang.String key, java.lang.String newMimeType)
添加chgm指令- Parameters:
bucket- 空间名key- 文件的 keynewMimeType- 修改后的 MimeType- Returns:
- BatchOperations
-
addCopyOp
public BucketManager.BatchOperations addCopyOp(java.lang.String fromBucket, java.lang.String fromFileKey, java.lang.String toBucket, java.lang.String toFileKey)
添加 copy 指令- Parameters:
fromBucket- 源空间名fromFileKey- 源文件的 keytoBucket- 目标空间名toFileKey- 目标文件的 key- Returns:
- BatchOperations
-
addRenameOp
public BucketManager.BatchOperations addRenameOp(java.lang.String fromBucket, java.lang.String fromFileKey, java.lang.String toFileKey)
添加重命名指令- Parameters:
fromBucket- 源空间名fromFileKey- 源文件的 keytoFileKey- 目标文件的 key- Returns:
- BatchOperations
-
addMoveOp
public BucketManager.BatchOperations addMoveOp(java.lang.String fromBucket, java.lang.String fromKey, java.lang.String toBucket, java.lang.String toKey)
添加move指令- Parameters:
fromBucket- 源空间名fromKey- 源文件的 keystoBucket- 目标空间名toKey- 目标文件的 keys- Returns:
- BatchOperations
-
addDeleteOp
public BucketManager.BatchOperations addDeleteOp(java.lang.String bucket, java.lang.String... keys)
添加delete指令- Parameters:
bucket- 空间名keys- 文件的 keys- Returns:
- BatchOperations
-
addStatOps
public BucketManager.BatchOperations addStatOps(java.lang.String bucket, java.lang.String... keys)
添加stat指令- Parameters:
bucket- 空间名keys- 文件的 keys- Returns:
- BatchOperations
-
addChangeTypeOps
public BucketManager.BatchOperations addChangeTypeOps(java.lang.String bucket, StorageType type, java.lang.String... keys)
添加changeType指令- Parameters:
bucket- keys 所在 buckettype- 存储类型keys- keys- Returns:
- BatchOperations
-
addChangeStatusOps
public BucketManager.BatchOperations addChangeStatusOps(java.lang.String bucket, int status, java.lang.String... keys)
添加 changeStatus 指令- Parameters:
bucket- keys 所在 bucketstatus- 存储状态keys- keys- Returns:
- BatchOperations
-
addDeleteAfterDaysOps
public BucketManager.BatchOperations addDeleteAfterDaysOps(java.lang.String bucket, int days, java.lang.String... keys)
添加 deleteAfterDays 指令- Parameters:
bucket- keys 所在 bucketdays- 天数keys- keys- Returns:
- BatchOperations
-
addRestoreArchiveOps
public BucketManager.BatchOperations addRestoreArchiveOps(java.lang.String bucket, int freezeAfterDays, java.lang.String... keys)
添加解冻归档存储指令- Parameters:
bucket- keys 所在 bucketfreezeAfterDays- 解冻有效时长,取值范围 1~7keys- keys- Returns:
- BatchOperations
-
toBody
public byte[] toBody()
-
merge
public BucketManager.BatchOperations merge(BucketManager.BatchOperations batch)
-
clearOps
public BucketManager.BatchOperations clearOps()
-
execBucket
public java.lang.String execBucket()
-
-