use of com.zhouzifei.tool.config.QiniuFileProperties in project simpleFS by shengdingbox.
the class QiniuApiClient method init.
@Override
public QiniuApiClient init(FileProperties fileProperties) {
final QiniuFileProperties qiniuFileProperties = fileProperties.getQiniu();
String accessKey = qiniuFileProperties.getAccessKey();
String secretKey = qiniuFileProperties.getSecretKey();
this.bucket = qiniuFileProperties.getBucketName();
String url = qiniuFileProperties.getUrl();
checkDomainUrl(url);
if (StringUtils.isNullOrEmpty(accessKey) || StringUtils.isNullOrEmpty(secretKey) || StringUtils.isNullOrEmpty(bucket)) {
throw new ServiceException("[" + this.storageType + "]尚未配置七牛云,文件上传功能暂时不可用!");
}
auth = Auth.create(accessKey, secretKey);
return this;
}
Aggregations