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

com.ksyun.ks3.service.request.GetBucketPolicyRequest Maven / Gradle / Ivy

package com.ksyun.ks3.service.request;

import com.ksyun.ks3.http.HttpMethod;
import com.ksyun.ks3.http.Request;
import com.ksyun.ks3.utils.StringUtils;

import static com.ksyun.ks3.exception.client.ClientIllegalArgumentExceptionGenerator.notNull;

public class GetBucketPolicyRequest extends Ks3WebServiceRequest {

    private String bucketName;

    public GetBucketPolicyRequest(String bucketName) {
        this.bucketName = bucketName;
    }

    @Override
    public void buildRequest(Request request) {
        request.setMethod(HttpMethod.GET);
        request.setBucket(bucketName);
        request.addQueryParam("policy", "");
    }

    @Override
    public void validateParams() {
        if (StringUtils.isBlank(this.bucketName))
            throw notNull("bucketName");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy