1 package com.bull.eclipse.jonas; 2 3 7 8 import java.io.File ; 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 jonasBase = null; 19 private Path directoryWeb = null; 20 private String webContext = null; 21 22 public HotDeploy(String jonasBase, Path directoryWeb, String 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 buildFileLocation = TemplateDirUtil.getTemplateDir() + File.separator + "HotDeploy.xml"; 33 antRunner.setBuildFileLocation(buildFileLocation); 34 String [] arguments = {"-DJonasBaseDir=" + jonasBase , "-DWebContext=" + webContext , "-DWebAppDir=" + directoryWeb.toOSString()}; 35 antRunner.setArguments(arguments); 36 antRunner.run(); 37 } 38 } | Popular Tags |