
com.qiniu.process.qoss.DeleteFile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qsuits Show documentation
Show all versions of qsuits Show documentation
qiniu-suits is a efficient tools for qiniu api implemented by java8.
package com.qiniu.process.qoss;
import com.qiniu.common.QiniuException;
import com.qiniu.process.Base;
import com.qiniu.storage.BucketManager;
import com.qiniu.storage.BucketManager.*;
import com.qiniu.storage.Configuration;
import com.qiniu.util.Auth;
import com.qiniu.util.HttpResponseUtils;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public class DeleteFile extends Base {
private BatchOperations batchOperations;
private BucketManager bucketManager;
public DeleteFile(String accessKey, String secretKey, Configuration configuration, String bucket, String rmPrefix,
String savePath, int saveIndex) throws IOException {
super("delete", accessKey, secretKey, configuration, bucket, rmPrefix, savePath, saveIndex);
this.batchSize = 1000;
this.batchOperations = new BatchOperations();
this.bucketManager = new BucketManager(Auth.create(accessKey, secretKey), configuration.clone());
}
public void updateDelete(String bucket, String rmPrefix) {
this.bucket = bucket;
this.rmPrefix = rmPrefix;
}
public DeleteFile(String accessKey, String secretKey, Configuration configuration, String bucket, String rmPrefix,
String savePath) throws IOException {
this(accessKey, secretKey, configuration, bucket, rmPrefix, savePath, 0);
}
public DeleteFile clone() throws CloneNotSupportedException {
DeleteFile deleteFile = (DeleteFile)super.clone();
deleteFile.bucketManager = new BucketManager(Auth.create(accessKey, secretKey), configuration.clone());
if (batchSize > 1) deleteFile.batchOperations = new BatchOperations();
return deleteFile;
}
@Override
synchronized protected String batchResult(List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy