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
A nice ant wrapper around sardine.put().
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguredFileset(org.apache.tools.ant.types.FileSet value) Add a source file set.org.apache.tools.ant.types.FilterChainAdd a FilterChain.org.apache.tools.ant.types.FilterSetAdd a filterset.protected voidexecute()Execute the command.Get the character encoding to be used.booleanGet the setting for in memory filtering.Get the character encoding for output files.voidsetContentType(String contentType) Set optional content type of the source file.voidsetEncoding(String encoding) Set the character encoding.voidSet source file.voidsetInMemoryFiltering(boolean inMemoryFiltering) Defines whether the filtering result should be stored in memory or in a temporary file before it becomes put.voidsetOutputEncoding(String encoding) Set the character encoding for output files.voidSet destination URL.protected voidThis is called prior toCommand.execute()in order to enable the command implementation to validate the provided attributes.Methods inherited from class Command
executeCommand, getSardine, setTaskMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
Put
public Put()
-
-
Method Details
-
execute
-
validateAttributes
This is called prior toCommand.execute()in order to enable the command implementation to validate the provided attributes.- Specified by:
validateAttributesin classCommand- Throws:
Exception- if the command is misconfigured
-
setUrl
Set destination URL. -
setFile
Set source file. -
setContentType
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
Set the character encoding.- Parameters:
encoding- the character encoding.
-
getEncoding
Get the character encoding to be used.- Returns:
- the character encoding,
nullif not set.
-
setOutputEncoding
Set the character encoding for output files.- Parameters:
encoding- the output character encoding.
-
getOutputEncoding
Get the character encoding for output files.- Returns:
- the character encoding for output files,
nullif 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 istrue;falsewill write the results to a temporary file
-