Search in sources :

Example 6 with BucketConfig

use of com.mendmix.cos.BucketConfig in project jeesuite-libs by vakinge.

the class MinioProvider method getBucketConfig.

@Override
public BucketConfig getBucketConfig(String bucketName) {
    if (!existsBucket(bucketName)) {
        return null;
    }
    boolean isPrivate = false;
    try {
        String bucketPolicy = minioClient.getBucketPolicy(GetBucketPolicyArgs.builder().bucket(bucketName).build());
        isPrivate = StringUtils.isEmpty(bucketPolicy) ? true : false;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    BucketConfig config = new BucketConfig(bucketName, isPrivate, null);
    return config;
}
Also used : BucketConfig(com.mendmix.cos.BucketConfig) JeesuiteBaseException(com.mendmix.common.JeesuiteBaseException)

Aggregations

BucketConfig (com.mendmix.cos.BucketConfig)6 JeesuiteBaseException (com.mendmix.common.JeesuiteBaseException)2 OSSException (com.aliyun.oss.OSSException)1 PolicyConditions (com.aliyun.oss.model.PolicyConditions)1 CUploadObject (com.mendmix.cos.CUploadObject)1 CannedAccessControlList (com.qcloud.cos.model.CannedAccessControlList)1 IOException (java.io.IOException)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 GetBucketPolicyResponse (software.amazon.awssdk.services.s3.model.GetBucketPolicyResponse)1