Commit 2578a7f5 authored by qiaokun's avatar qiaokun

修改bootstrap.java

parent 1b8e39ef
......@@ -41,7 +41,7 @@ public class Bootstrap implements Container {
private String context;
public Bootstrap() {
this(System.getProperty("user.dir"), webapp, webapp, "destWork");
this(null, webapp, webapp, "destWork");
}
public Bootstrap(String originRoot) {
......@@ -54,13 +54,23 @@ public class Bootstrap implements Container {
public Bootstrap(String originRoot, String webapp, String destRoot, String destDirectory) {
//设置默认context为当前项目名称
String projectPath = System.getProperty("user.dir");
File temp = new File(projectPath);
this.context = temp.getName();
File parent = null;
String parentPath = null;
if (originRoot==null){
//设置默认context为当前项目名称
String projectClassPath = this.getClass().getResource("/").getPath();
File temp = new File(projectClassPath);
parent = temp.getParentFile().getParentFile();
parentPath = parent.getPath();
}else {
parent = new File(originRoot);
parentPath = originRoot;
}
this.context = parent.getName();
this.projectPath = parentPath;
this.originWebappFile = new File(parentPath, webapp);
this.projectPath = originRoot;
this.originWebappFile = new File(projectPath, webapp);
if (webapp != destRoot && !webapp.equals(destRoot)) {
this.destDirectoryFile = new File(destRoot, destDirectory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment