All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qiniu.service.qoss.DeleteFile Maven / Gradle / Ivy

There is a newer version: 8.4.8
Show newest version
package com.qiniu.service.qoss;

import com.qiniu.storage.BucketManager.BatchOperations;
import com.qiniu.service.interfaces.ILineProcess;
import com.qiniu.storage.Configuration;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public class DeleteFile extends OperationBase implements ILineProcess>, Cloneable {

    public DeleteFile(String accessKey, String secretKey, Configuration configuration, String bucket, String savePath,
                      int saveIndex) throws IOException {
        super("delete", accessKey, secretKey, configuration, bucket, savePath, saveIndex);
    }

    public DeleteFile(String accessKey, String secretKey, Configuration configuration, String bucket, String savePath)
            throws IOException {
        this(accessKey, secretKey, configuration, bucket, savePath, 0);
    }

    synchronized public BatchOperations getOperations(List> lineList) {
        batchOperations.clearOps();
        lineList.forEach(line -> {
            if (line.get("key") == null)
                errorLineList.add(String.valueOf(line) + "\tno target key in the line map.");
            else
                batchOperations.addDeleteOp(bucket, line.get("key"));
        });
        return batchOperations;
    }

    public String getInputParams(Map line) {
        return line.get("key");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy