Class Command

java.lang.Object
org.apache.tools.ant.ProjectComponent
com.github.sardine.ant.Command
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Copy, CreateDirectory, Delete, Exists, Move, Put, RecursiveGet

public abstract class Command extends org.apache.tools.ant.ProjectComponent
Base class for a Command which represents a sardine command such as sardine.put().
  • Field Summary

    Fields inherited from class org.apache.tools.ant.ProjectComponent

    description, location, project
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Execute the command.
    final void
    Check the command attribute and execute it.
    protected final Sardine
    Returns the Sardine for this command.
    final void
    Sets the SardineTask
    protected abstract void
    This is called prior to execute() in order to enable the command implementation to validate the provided attributes.

    Methods inherited from class org.apache.tools.ant.ProjectComponent

    clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Command

      public Command()
  • Method Details

    • validateAttributes

      protected abstract void validateAttributes() throws Exception
      This is called prior to execute() in order to enable the command implementation to validate the provided attributes.
      Throws:
      Exception - if the command is misconfigured
    • execute

      protected abstract void execute() throws Exception
      Execute the command.
      Throws:
      Exception - if the command failed
    • executeCommand

      public final void executeCommand() throws Exception
      Check the command attribute and execute it.
      Throws:
      Exception - if the command is misconfigured or failed for some other reason
    • setTask

      public final void setTask(SardineTask task)
      Sets the SardineTask
    • getSardine

      protected final Sardine getSardine()
      Returns the Sardine for this command.
      Returns:
      the Sardine for this command