use of com.ruoyi.oss.exception.OssException in project RuoYi-Flowable-Plus by KonBAI-Q.
the class OssFactory method refresh.
private static void refresh(String type) {
Object json = RedisUtils.getCacheObject(OssConstant.SYS_OSS_KEY + type);
OssProperties properties = JsonUtils.parseObject(json.toString(), OssProperties.class);
if (properties == null) {
throw new OssException("系统异常, '" + type + "'配置信息不存在!");
}
getStrategy(type).init(properties);
}
use of com.ruoyi.oss.exception.OssException in project RuoYi-Flowable-Plus by KonBAI-Q.
the class AliyunOssStrategy method createBucket.
@Override
public void createBucket() {
try {
String bucketName = properties.getBucketName();
if (client.doesBucketExist(bucketName)) {
return;
}
CreateBucketRequest createBucketRequest = new CreateBucketRequest(bucketName);
createBucketRequest.setCannedACL(CannedAccessControlList.PublicRead);
client.createBucket(createBucketRequest);
} catch (Exception e) {
throw new OssException("创建Bucket失败, 请核对阿里云配置信息:[" + e.getMessage() + "]");
}
}
Aggregations