diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java index 5b1ba9c893..f3e813c92d 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java @@ -46,13 +46,20 @@ public interface TemplateFileResourceOperation { boolean closeTemplate(String path); /** - * 重命名模板/路径 + * 重命名模板/目录 * @param from * @param to * @return */ boolean rename(String from, String to); + /** + * 模板/目录是否存在 + * @param path + * @return + */ + boolean exist(String path); + /** * 创建目录 * @param path diff --git a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java index e72d78fca0..88a3f85645 100644 --- a/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java +++ b/designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java @@ -40,6 +40,11 @@ public class DefaultTemplateFileResourceOperation implements TemplateFileResourc return WorkContext.getCurrent().get(TplOperator.class).rename(from, to); } + @Override + public boolean exist(String path) { + return WorkContext.getWorkResource().exist(path); + } + @Override public boolean mkdir(String path) { return WorkContext.getWorkResource().createDirectory(path); diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index ac109606f9..3e8178b2d7 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -323,7 +323,7 @@ public class FileNodeFILE implements FILE { } try { - return WorkContext.getWorkResource().exist(node.getEnvPath()); + return TemplateFileResourceManager.getOperation().exist(node.getEnvPath()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false;