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().
Author:
jonstevens
  • Field Summary

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

    description, location, project
  • Constructor Summary

    Constructors 
    Constructor Description
    Command()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract void execute()
    Execute the command.
    void executeCommand()
    Check the command attribute and execute it.
    protected Sardine getSardine()
    Returns the Sardine for this command.
    void setTask​(SardineTask task)
    Sets the SardineTask
    protected abstract void validateAttributes()
    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 java.lang.Object

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

  • 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