1 23 24 package org.enhydra.kelp.common.deployer; 25 26 import org.enhydra.tool.ToolBoxInfo; 28 29 import org.enhydra.kelp.common.Constants; 31 import org.enhydra.kelp.common.PathUtil; 32 import org.enhydra.kelp.common.node.OtterProject; 33 34 import java.io.File ; 36 import java.io.FileWriter ; 37 import java.io.PrintWriter ; 38 39 public class StartServerGenerator { 40 private OtterProject project = null; 41 private File directory; 42 private File file = null; 43 44 50 public StartServerGenerator(OtterProject p) { 51 project = p; 52 } 53 54 60 public File getFile() { 61 String path = project.getSourcePathArray()[0]; 62 File dir = new File (path); 63 file = new File (dir, Constants.FILE_START_SERVER); 64 return file; 65 } 66 67 74 public void create() throws java.io.IOException { 75 if ((!getFile().exists()) || project.isDeployOverwrite()) { 76 PrintWriter out = new PrintWriter (new FileWriter (getFile())); 77 78 out.println(' '); 80 out.println("// "); 81 out.println("// You can run this class to start the Enhydra "); 82 out.println("// application server from your IDE."); 83 out.println("// "); 84 out.println("// Note: The <enhydra_root>/tool/lib/toolbox.jar "); 85 out.println("// must be in your class path to compile or run "); 86 out.println("// this class."); 87 out.println("// "); 88 out.println(' '); 89 out.println("public class StartServer extends org.enhydra.tool.boot.StartServer {"); out.println(' '); 91 out.println(" public static void main(String[] args) {"); out.println(" org.enhydra.tool.boot.StartServer.main(args);"); 93 out.println(" }"); 94 out.println(' '); 95 out.println('}'); 96 out.println(' '); 97 out.flush(); 98 out.close(); 99 } 100 } 101 102 103 } 104 | Popular Tags |