Class Put

java.lang.Object
org.apache.tools.ant.ProjectComponent
com.github.sardine.ant.Command
com.github.sardine.ant.command.Put
All Implemented Interfaces:
Cloneable

public class Put extends Command
A nice ant wrapper around sardine.put().
  • Constructor Details

    • Put

      public Put()
  • Method Details

    • execute

      protected void execute() throws Exception
      Execute the command.
      Specified by:
      execute in class Command
      Throws:
      Exception - if the command failed
    • validateAttributes

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

      public void setUrl(String urlString)
      Set destination URL.
    • setFile

      public void setFile(File file)
      Set source file.
    • setContentType

      public void setContentType(String contentType)
      Set optional content type of the source file.
    • addConfiguredFileset

      public void addConfiguredFileset(org.apache.tools.ant.types.FileSet value)
      Add a source file set.
    • createFilterSet

      public org.apache.tools.ant.types.FilterSet createFilterSet()
      Add a filterset.
      Returns:
      a filter set object.
    • createFilterChain

      public org.apache.tools.ant.types.FilterChain createFilterChain()
      Add a FilterChain.
      Returns:
      a filter chain object.
    • setEncoding

      public void setEncoding(String encoding)
      Set the character encoding.
      Parameters:
      encoding - the character encoding.
    • getEncoding

      public String getEncoding()
      Get the character encoding to be used.
      Returns:
      the character encoding, null if not set.
    • setOutputEncoding

      public void setOutputEncoding(String encoding)
      Set the character encoding for output files.
      Parameters:
      encoding - the output character encoding.
    • getOutputEncoding

      public String getOutputEncoding()
      Get the character encoding for output files.
      Returns:
      the character encoding for output files, null if not set.
    • getInMemoryFiltering

      public boolean getInMemoryFiltering()
      Get the setting for in memory filtering.
      Returns:
      the setting for in memory filtering
    • setInMemoryFiltering

      public void setInMemoryFiltering(boolean inMemoryFiltering)
      Defines whether the filtering result should be stored in memory or in a temporary file before it becomes put.

      Due to the filtering implementation of Ant is not done in a streaming manner, it is required to store the result before it can be put to the destination URL. For small files it is reasonable to hold the result in memory. Large files will require a according amount of heap memory and thus it is advisable to turn the in memory buffer off.

      Parameters:
      inMemoryFiltering - default is true; false will write the results to a temporary file