From 60cd56fc1343bc91e2cd1c40ff0ecae45ebba626 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Dec 2020 17:54:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-44644=20=E6=B7=BB=E5=8A=A0=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/TemplateFileResourceOperation.java | 9 ++++++++- .../file/impl/DefaultTemplateFileResourceOperation.java | 5 +++++ .../src/main/java/com/fr/file/FileNodeFILE.java | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) 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;