Browse Source

REPORT-44644 添加判断是否存在接口

feature/big-screen
hades 4 years ago
parent
commit
60cd56fc13
  1. 9
      designer-base/src/main/java/com/fr/design/file/TemplateFileResourceOperation.java
  2. 5
      designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateFileResourceOperation.java
  3. 2
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java

9
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

5
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);

2
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;

Loading…
Cancel
Save