1 package org.enhydra.tool; 2 3 import org.enhydra.tool.common.PathHandle; 4 import java.io.File ; 5 import java.util.Properties ; 6 7 15 16 public class InitEnhydraRoot { 17 18 public InitEnhydraRoot() { 19 } 20 21 public static void main(String args[]) { 22 String enhydraRoot = args[0]; 23 PathHandle path = null; 24 Properties props = null; 25 String message = null; 26 27 path = PathHandle.createPathHandle(enhydraRoot); 28 if (path.isDirectory() && ToolBoxInfo.isEnhydraRoot(path.getPath())) { 29 try { 30 props=new Properties (); 32 String projectDir=path.getPath()+File.separator+"myProjects"; 33 props.setProperty("webapp.root", projectDir); 34 props.setProperty("enapp.root", projectDir); 35 props.setProperty(ToolBoxInfo.ENHYDRA_ROOT, path.getPath()); 36 ToolBoxInfo.storeProperties(props); 37 } catch (Exception e) { 38 e.printStackTrace(); 39 } 40 } 41 } 42 43 } | Popular Tags |