All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.minsin.aliyun.oss.config.MutilsAliyunOssMultiProperties Maven / Gradle / Ivy

Go to download

mutils组件中提供阿里云对象储存(OSS)等操作,该组件不可单独引用至maven依赖。详情请查看AliyunOssUploadFunctions、AliyunOssDownloadFunctions、AliyunOssManageFunctions 官方文档:https://help.aliyun.com/document_detail/32008.html

There is a newer version: 0.4.0.RELEASE
Show newest version
package cn.minsin.aliyun.oss.config;

import cn.minsin.core.exception.MutilsException;
import cn.minsin.core.init.AbstractChildrenConfig;
import cn.minsin.core.tools.StringUtil;
import lombok.Getter;
import lombok.Setter;

/**
 * 阿里云oss子配置项
 *
 * @author mintonzhang
 * @date 2019年2月13日
 * @since 0.2.8
 */
@Getter
@Setter
public class MutilsAliyunOssMultiProperties extends AbstractChildrenConfig {
    /**
     * 默认储存空间
     */
    private String bucketName;

    /**
     * 默认保存目录
     */
    private String saveDir;


    public String createOssSaveDir(String fileName) {
        if (saveDir == null) {
            return fileName;
        }
        return saveDir + "/" + fileName;
    }

    @Override
    public void checkConfig() {
        slog.info("The child Config named 'AliyunOssMultiConfig',Required for initialization bucketName, saveDir.", this.getClass());
        if (StringUtil.isBlank(bucketName, saveDir)) {
            throw new MutilsException("The child Config named 'AliyunOssMultiConfig' was initialization failed. ");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy