|
|
|
@ -1,9 +1,14 @@
|
|
|
|
|
package com.fr.design.env; |
|
|
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.stable.CoreConstants; |
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
|
import com.fr.workspace.connect.WorkspaceConnectionInfo; |
|
|
|
|
import com.fr.workspace.engine.exception.MainVersionNotMatchException; |
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.util.Properties; |
|
|
|
@ -94,18 +99,18 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
|
|
|
|
|
@Override |
|
|
|
|
public boolean checkValid(){ |
|
|
|
|
File file = new File(this.path); |
|
|
|
|
////判断不是文件夹/路径不在WEB-INF下/代码启动三种情况
|
|
|
|
|
//if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF") || this.path.startsWith(".")) {
|
|
|
|
|
// return false;
|
|
|
|
|
//}
|
|
|
|
|
//
|
|
|
|
|
//File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR));
|
|
|
|
|
//// 非安装版本允许自由切换
|
|
|
|
|
//boolean notExistLib = !CoreConstants.DOT.equals(StableUtils.getInstallHome())
|
|
|
|
|
// && !engineLib.exists();
|
|
|
|
|
//if (notExistLib) {
|
|
|
|
|
// throw new MainVersionNotMatchException();
|
|
|
|
|
//}
|
|
|
|
|
//判断不是文件夹/路径不在WEB-INF下/代码启动三种情况
|
|
|
|
|
if(!file.isDirectory() || !ComparatorUtils.equals(file.getName(), "WEB-INF") || this.path.startsWith(".")) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR)); |
|
|
|
|
// 非安装版本允许自由切换
|
|
|
|
|
boolean notExistLib = !CoreConstants.DOT.equals(StableUtils.getInstallHome()) |
|
|
|
|
&& !engineLib.exists(); |
|
|
|
|
if (notExistLib) { |
|
|
|
|
throw new MainVersionNotMatchException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|