Back to Summer Batch home page

FTP operations support

Two dedicated ftp operations tasklets are provided in Summer Batch:

  • Summer.Batch.Extra.FtpSupport.FtpPutTasklet: provides a basic ftp put operation support;

  • Summer.Batch.Extra.FtpSupport.FtpGetTasklet: provides a basic ftp get operation support.

Both are using the System.Net.FtpWebRequest ftp client.

Ftp put operations

Using the FtpPutTasklet, you can put a given file on a ftp remote directory. The following properties are mandatory (need to be set at initialization time):

  • FileName : path to the file that will be put on the ftp remote directory;

  • Host : ftp host (name or I.P. address);

  • Username : the user name to use to connect to the ftp host;

  • Password : password for the above ftp user.

The following properties are optional (need to be set at initialization time, but a default value is provided):

  • Port : ftp host port (if non standard). Defaults to 21;

  • RemoteDirectory : path to ftp remote directory. Defaults to empty string, meaning that the defaut remote directory is the ftp root directory.

Configuring the FtpPutTasklet in the job xml file:

Example 7.8. FtpPutTasklet usage in the job xml file


and here is a sample Unity configuration:


Using the FtpGetTasklet, you can get a given set of files from a ftp remote directory. The following properties are mandatory (need to be set at initialization time):

The following properties are optional (need to be set at initialization time, but a default value is provided):

  • Port : ftp host port (if non standard). Defaults to 21;

  • AutoCreateLocalDirectory : defaults to true; see LocalDirectory item above for the meaning of this flag;

  • DownloadFileAttempts : number of file download attempts before giving up; defaults to 12;

  • RetryIntervalMilliseconds : Time in milliseconds to wait for a retry (after a failure); defaults to 300000;

  • DeleteLocalFiles : boolean flag (defaults to true) to indicate whether local existing files (from a prior download for example) will be deleted before attempting a fresh download. The FileNamePattern property will be used to filter the files that need deletion.

Configuring the FtpGetTasklet in the job xml file:

Example 7.10. FtpGetTasklet usage in the job xml file


and here is a sample Unity configuration :


Back to Summer Batch home page