mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
enhancement #I4M3Q4 支持配置绝对路径的配置文件
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow</artifactId>
|
||||
<version>2.6.6</version>
|
||||
<version>2.6.6-BETA</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -72,10 +72,19 @@ public abstract class FlowParser {
|
||||
|
||||
List<Resource> allResource = new ArrayList<>();
|
||||
for (String path : pathList) {
|
||||
String locationPattern = path;
|
||||
if (!locationPattern.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) {
|
||||
locationPattern = ResourceUtils.CLASSPATH_URL_PREFIX + locationPattern;
|
||||
String locationPattern;
|
||||
|
||||
//如果path是绝对路径且这个文件存在时,我们认为这是一个本地文件路径,而并非classpath路径
|
||||
if (FileUtil.isAbsolutePath(path) && FileUtil.isFile(path)){
|
||||
locationPattern = ResourceUtils.FILE_URL_PREFIX + path;
|
||||
} else {
|
||||
if (!path.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) {
|
||||
locationPattern = ResourceUtils.CLASSPATH_URL_PREFIX + path;
|
||||
}else{
|
||||
locationPattern = path;
|
||||
}
|
||||
}
|
||||
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
Resource[] resources = resolver.getResources(locationPattern);
|
||||
if (ArrayUtil.isEmpty(resources)) {
|
||||
|
||||
Reference in New Issue
Block a user