KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > tool > InitEnhydraRoot


1 package org.enhydra.tool;
2
3 import org.enhydra.tool.common.PathHandle;
4 import java.io.File JavaDoc;
5 import java.util.Properties JavaDoc;
6
7 /**
8  * <p>Title: </p>
9  * <p>Description: </p>
10  * <p>Copyright: Copyright (c) 2003</p>
11  * <p>Company: </p>
12  * @author dacha&strale
13  * @version 1.0
14  */

15
16 public class InitEnhydraRoot {
17
18     public InitEnhydraRoot() {
19     }
20
21     public static void main(String JavaDoc args[]) {
22         String JavaDoc enhydraRoot = args[0];
23         PathHandle path = null;
24         Properties JavaDoc props = null;
25         String JavaDoc message = null;
26
27         path = PathHandle.createPathHandle(enhydraRoot);
28         if (path.isDirectory() && ToolBoxInfo.isEnhydraRoot(path.getPath())) {
29             try {
30               // props = ToolBoxInfo.loadProperties();
31
props=new Properties JavaDoc();
32                 String JavaDoc 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 JavaDoc e) {
38                 e.printStackTrace();
39             }
40         }
41     }
42
43 }
Popular Tags