FileDocCategorySizeDatePackage
DeployTask.javaAPI DocGlassfish v2 API3604Fri May 04 22:32:42 BST 2007org.apache.tools.ant.taskdefs.optional.iplanet

DeployTask

public class DeployTask extends ComponentAdmin

Fields Summary
private static final String
DEPLOY_COMMAND
Constructors Summary
Methods Summary
protected voidcheckComponentConfig(Component comp)


	      
		super.checkComponentConfig(comp);

		// file must exist (either directory or file)
		File theFile = comp.getFile();
		if ((theFile == null) || (!theFile.exists())) {
			String msg = "The file specified (" + theFile + ") could not be found.";
			throw new BuildException(msg, getLocation());
		}

		// contextroot only makes sense when deploying web components
		String theType = comp.getType();
		if ((theType != null) && (!theType.equals(TYPE_WEB)) && (comp.contextRootIsSet())) {
			String msg = "The \"contextroot\" attribute doesn't apply to "
							+ comp.getType() + " files -- it only applies to war files.";
			log(msg, Project.MSG_WARN);
		}
	
protected java.lang.StringgetCommandString(Server server, Component comp)

		StringBuffer cmdString = new StringBuffer(DEPLOY_COMMAND);
		cmdString.append(server.getCommandParameters(true));
		if (comp.getType() != null) {
			cmdString.append(" --type ").append(comp.getType());
			if (comp.getType().equals(TYPE_WEB)) {
				cmdString.append(" --contextroot ").append(comp.getContextroot());
			}
		}

		cmdString.append(" --force=").append(comp.getForce());
		cmdString.append(" --name ").append(comp.getName());
		cmdString.append(" --upload=").append(comp.getUpload());
		cmdString.append(" ").append(comp.getFile().getPath());

		return cmdString.toString();