mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-10 03:07:32 +08:00
bug #I3IG1K springboot的fat jar模式下,流程文件会找不到的问题
This commit is contained in:
@@ -2,8 +2,8 @@ package com.yomahub.liteflow.parser;
|
||||
|
||||
/**
|
||||
* 基于自定义的Yml方式解析器
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public abstract class ClassYmlFlowParser extends YmlFlowParser{
|
||||
@Override
|
||||
|
||||
@@ -12,8 +12,8 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public abstract class FlowParser {
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* Json格式解析器
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public abstract class JsonFlowParser extends FlowParser{
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.yomahub.liteflow.parser;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public class LocalJsonFlowParser extends JsonFlowParser{
|
||||
|
||||
@Override
|
||||
public void parseMain(String rulePath) throws Exception {
|
||||
String ruleContent = FileUtil.readUtf8String(rulePath);
|
||||
String ruleContent = ResourceUtil.readUtf8Str(StrUtil.format("classpath:{}",rulePath));
|
||||
parse(ruleContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
package com.yomahub.liteflow.parser;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* 基于本地的xml方式解析器
|
||||
@@ -16,7 +18,7 @@ import cn.hutool.core.io.FileUtil;
|
||||
public class LocalXmlFlowParser extends XmlFlowParser{
|
||||
|
||||
public void parseMain(String rulePath) throws Exception {
|
||||
String ruleContent = FileUtil.readUtf8String(rulePath);
|
||||
String ruleContent = ResourceUtil.readUtf8Str(StrUtil.format("classpath:{}",rulePath));
|
||||
parse(ruleContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.yomahub.liteflow.parser;
|
||||
/**
|
||||
* Yaml格式转换
|
||||
*
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public class LocalYmlFlowParser extends YmlFlowParser {
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.yomahub.liteflow.parser;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -10,8 +12,8 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Yml格式解析器,转换为json格式进行解析
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public abstract class YmlFlowParser extends JsonFlowParser{
|
||||
|
||||
@@ -19,7 +21,7 @@ public abstract class YmlFlowParser extends JsonFlowParser{
|
||||
|
||||
@Override
|
||||
public void parseMain(String rulePath) throws Exception {
|
||||
String ruleContent = FileUtil.readUtf8String(rulePath);
|
||||
String ruleContent = ResourceUtil.readUtf8Str(StrUtil.format("classpath:{}",rulePath));
|
||||
JSONObject ruleObject = convertToJson(ruleContent);
|
||||
parse(ruleObject.toJSONString());
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* 基于zk方式的json形式的解析器
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public class ZookeeperJsonFlowParser extends JsonFlowParser{
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* 基于zk方式的yml形式的解析器
|
||||
* @author: guodongqing
|
||||
* @since: 2.5.0
|
||||
* @author guodongqing
|
||||
* @since 2.5.0
|
||||
*/
|
||||
public class ZookeeperYmlFlowParser extends YmlFlowParser{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user