Search in sources :

Example 1 with UpaiManager

use of com.zhouzifei.tool.common.upaiyun.UpaiManager in project simpleFS by shengdingbox.

the class UpaiyunOssApiClient method init.

@Override
public UpaiyunOssApiClient init(FileProperties fileProperties) {
    final UpaiFileProperties upaiFileProperties = fileProperties.getUpai();
    String userName = upaiFileProperties.getUserName();
    String passWord = upaiFileProperties.getPassWord();
    String url = upaiFileProperties.getUrl();
    String bucketName = upaiFileProperties.getBucketName();
    checkDomainUrl(url);
    if (StringUtils.isNullOrEmpty(userName) || StringUtils.isNullOrEmpty(passWord) || StringUtils.isNullOrEmpty(bucketName)) {
        throw new ServiceException("[" + this.storageType + "]尚未配置又拍云,文件上传功能暂时不可用!");
    }
    upaiManager = new UpaiManager(bucketName, userName, passWord);
    return this;
}
Also used : UpaiFileProperties(com.zhouzifei.tool.config.UpaiFileProperties) UpaiManager(com.zhouzifei.tool.common.upaiyun.UpaiManager) ServiceException(com.zhouzifei.tool.common.ServiceException)

Aggregations

ServiceException (com.zhouzifei.tool.common.ServiceException)1 UpaiManager (com.zhouzifei.tool.common.upaiyun.UpaiManager)1 UpaiFileProperties (com.zhouzifei.tool.config.UpaiFileProperties)1