1 23 24 package org.apache.tools.ant.taskdefs.optional.iplanet; 25 26 import org.apache.tools.ant.BuildException; 27 28 public class UndeployTask extends ComponentAdmin { 29 private static final String UNDEPLOY_COMMAND = "undeploy"; 30 31 protected void checkComponentConfig(Component comp) throws BuildException { 32 super.checkComponentConfig(comp); 33 34 String theName = comp.getName(); 36 if ((theName == null) || (theName.length() == 0)) { 37 String msg = "The component name (\"" + theName + "\") is not valid"; 38 throw new BuildException(msg, getLocation()); 39 } 40 } 41 42 protected String getCommandString(Server server, Component comp) { 43 StringBuffer cmdString = new StringBuffer (UNDEPLOY_COMMAND); 44 cmdString.append(server.getCommandParameters(true)); 45 if (comp.getType() != null) { 46 cmdString.append(" --type ").append(comp.getType()); 47 } 48 cmdString.append(" ").append(comp.getName()); 49 50 return cmdString.toString(); 51 } 52 } | Popular Tags |