Search in sources :

Example 1 with OssEnumd

use of com.ruoyi.oss.enumd.OssEnumd in project RuoYi-Flowable-Plus by KonBAI-Q.

the class OssFactory method instance.

/**
 * 根据类型获取实例
 */
public static IOssStrategy instance(String type) {
    OssEnumd enumd = OssEnumd.find(type);
    if (enumd == null) {
        throw new OssException("文件存储服务类型无法找到!");
    }
    AbstractOssStrategy strategy = getStrategy(type);
    if (!strategy.isInit) {
        refresh(type);
    }
    return strategy;
}
Also used : OssEnumd(com.ruoyi.oss.enumd.OssEnumd) AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy) OssException(com.ruoyi.oss.exception.OssException)

Example 2 with OssEnumd

use of com.ruoyi.oss.enumd.OssEnumd in project RuoYi-Vue-Plus by JavaLionLi.

the class OssFactory method instance.

/**
 * 根据类型获取实例
 */
public static IOssStrategy instance(String type) {
    OssEnumd enumd = OssEnumd.find(type);
    if (enumd == null) {
        throw new OssException("文件存储服务类型无法找到!");
    }
    AbstractOssStrategy strategy = getStrategy(type);
    if (!strategy.isInit) {
        refresh(type);
    }
    return strategy;
}
Also used : OssEnumd(com.ruoyi.oss.enumd.OssEnumd) AbstractOssStrategy(com.ruoyi.oss.service.abstractd.AbstractOssStrategy) OssException(com.ruoyi.oss.exception.OssException)

Aggregations

OssEnumd (com.ruoyi.oss.enumd.OssEnumd)2 OssException (com.ruoyi.oss.exception.OssException)2 AbstractOssStrategy (com.ruoyi.oss.service.abstractd.AbstractOssStrategy)2