Search in sources :

Example 1 with FastDfsFileProperties

use of com.zhouzifei.tool.config.FastDfsFileProperties in project simpleFS by shengdingbox.

the class FastDfsOssApiClient method init.

@Override
public FastDfsOssApiClient init(FileProperties fileProperties) {
    final FastDfsFileProperties fastDfsFileProperties = fileProperties.getFast();
    this.serverUrl = fastDfsFileProperties.getServerUrl();
    this.domainUrl = fastDfsFileProperties.getUrl();
    checkDomainUrl(domainUrl);
    Properties props = new Properties();
    props.put(ClientGlobal.PROP_KEY_TRACKER_SERVERS, serverUrl);
    try {
        ClientGlobal.initByProperties(props);
    } catch (IOException e) {
        throw new ServiceException("[" + this.storageType + "]尚未配置阿里云FastDfs,文件上传功能暂时不可用!");
    }
    return this;
}
Also used : FastDfsFileProperties(com.zhouzifei.tool.config.FastDfsFileProperties) ServiceException(com.zhouzifei.tool.common.ServiceException) IOException(java.io.IOException) FileProperties(com.zhouzifei.tool.config.FileProperties) FastDfsFileProperties(com.zhouzifei.tool.config.FastDfsFileProperties)

Aggregations

ServiceException (com.zhouzifei.tool.common.ServiceException)1 FastDfsFileProperties (com.zhouzifei.tool.config.FastDfsFileProperties)1 FileProperties (com.zhouzifei.tool.config.FileProperties)1 IOException (java.io.IOException)1