1 17 package org.apache.servicemix.jbi.management.task; 18 19 import java.io.File ; 20 21 import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean; 22 import org.apache.tools.ant.BuildException; 23 24 29 public class DeployServiceAssemblyTask extends JbiTask { 30 31 private String file; 33 36 public String getFile() { 37 return file; 38 } 39 42 public void setFile(String file) { 43 this.file = file; 44 } 45 46 50 public void doExecute(AdminCommandsServiceMBean acs) throws Exception { 51 if (file == null){ 52 throw new BuildException("null file - file should be an archive"); 53 } 54 if (!file.endsWith(".zip") && !file.endsWith(".jar")) { 55 throw new BuildException("file: " + file + " is not an archive"); 56 } 57 File archive = new File (file); 58 String location = archive.getAbsolutePath(); 59 if (!archive.isFile()) { 60 location = file; 62 } 63 acs.deployServiceAssembly(location); 64 } 65 66 } | Popular Tags |