org.springframework.build.aws.ant
Class Download

java.lang.Object
  extended by org.springframework.build.aws.ant.AbstractS3Operation
      extended by org.springframework.build.aws.ant.AbstractS3DownloadOperation
          extended by org.springframework.build.aws.ant.Download
All Implemented Interfaces:
S3Operation

public class Download
extends AbstractS3DownloadOperation

A member of the S3 ANT task for dealing with Amazon S3 download behavior. This operation will use the credentials setup in its parent S3 task tag.

Author:
Ben Hale

Field Summary
private  java.lang.String file
           
private  java.util.List<org.apache.tools.ant.types.FileSet> fileSets
           
private  java.io.File toDir
           
private  java.io.File toFile
           
 
Fields inherited from class org.springframework.build.aws.ant.AbstractS3Operation
bucketName, project
 
Constructor Summary
Download()
           
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
          Adds an optional fileSet to read files from.
 void execute(org.jets3t.service.S3Service service)
          Execute an S3 operation
 void init()
          Verify that required parameters have been set
private  void processFileToDir(org.jets3t.service.S3Service service)
           
private  void processFileToFile(org.jets3t.service.S3Service service)
           
private  void processSetToDir(org.jets3t.service.S3Service service)
           
 void setFile(java.lang.String file)
          Optional parameter that corresponds to the source object key in S3
 void setToDir(java.io.File toDir)
          Optional parameter that corresponds to the target object directory
 void setToFile(java.io.File toFile)
          Required parameter that corresponds to the file to download
 
Methods inherited from class org.springframework.build.aws.ant.AbstractS3DownloadOperation
getFile
 
Methods inherited from class org.springframework.build.aws.ant.AbstractS3Operation
getOperationBucket, getS3SafeDirectory, getS3Scanner, setBucketName, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private java.lang.String file

fileSets

private java.util.List<org.apache.tools.ant.types.FileSet> fileSets

toDir

private java.io.File toDir

toFile

private java.io.File toFile
Constructor Detail

Download

public Download()
Method Detail

setFile

public void setFile(java.lang.String file)
Optional parameter that corresponds to the source object key in S3

Parameters:
file - The source object key in S3

addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet fileSet)
Adds an optional fileSet to read files from.

Parameters:
fileSet - The set of files to download

setToDir

public void setToDir(java.io.File toDir)
Optional parameter that corresponds to the target object directory

Parameters:
toDir - The target object directory

setToFile

public void setToFile(java.io.File toFile)
Required parameter that corresponds to the file to download

Parameters:
toFile - The file to download

init

public void init()
Verify that required parameters have been set


execute

public void execute(org.jets3t.service.S3Service service)
             throws org.jets3t.service.S3ServiceException,
                    java.io.IOException
Description copied from interface: S3Operation
Execute an S3 operation

Parameters:
service - The S3 Service to execute against
Throws:
org.jets3t.service.S3ServiceException
java.io.IOException

processFileToFile

private void processFileToFile(org.jets3t.service.S3Service service)
                        throws org.jets3t.service.S3ServiceException,
                               java.io.IOException
Throws:
org.jets3t.service.S3ServiceException
java.io.IOException

processFileToDir

private void processFileToDir(org.jets3t.service.S3Service service)
                       throws org.jets3t.service.S3ServiceException,
                              java.io.IOException
Throws:
org.jets3t.service.S3ServiceException
java.io.IOException

processSetToDir

private void processSetToDir(org.jets3t.service.S3Service service)
                      throws org.jets3t.service.S3ServiceException,
                             java.io.IOException
Throws:
org.jets3t.service.S3ServiceException
java.io.IOException