KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > HotDeploy


1 package com.bull.eclipse.jonas;
2
3 /*
4  * (c) Copyright Bull SA 2003.
5  * All Rights Reserved.
6  */

7  
8 import java.io.File JavaDoc;
9
10 import org.eclipse.ant.core.AntRunner;
11 import org.eclipse.core.runtime.CoreException;
12 import org.eclipse.core.runtime.Path;
13
14 import com.bull.eclipse.jonas.utils.TemplateDirUtil;
15
16 public class HotDeploy {
17     
18     private String JavaDoc jonasBase = null;
19     private Path directoryWeb = null;
20     private String JavaDoc webContext = null;
21     
22     public HotDeploy(String JavaDoc jonasBase, Path directoryWeb, String JavaDoc webContext) throws CoreException {
23         this.jonasBase = jonasBase;
24         this.directoryWeb = directoryWeb;
25         this.webContext = webContext;
26     }
27     
28     
29     public void copyFileByAnt() throws CoreException {
30                         
31         AntRunner antRunner = new AntRunner();
32         String JavaDoc buildFileLocation = TemplateDirUtil.getTemplateDir() + File.separator + "HotDeploy.xml";
33         antRunner.setBuildFileLocation(buildFileLocation);
34         String JavaDoc[] arguments = {"-DJonasBaseDir=" + jonasBase , "-DWebContext=" + webContext , "-DWebAppDir=" + directoryWeb.toOSString()};
35         antRunner.setArguments(arguments);
36         antRunner.run();
37     }
38 }
Popular Tags