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 FTP put operation support;

  • Summer.Batch.Extra.FtpSupport.FtpGetTasklet: provides FTP get operation support.

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

FTP put operations

Using FtpPutTasklet you can put a given file into 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 connect to FTP host;

  • Password : password for the above FTP user.

The following properties are optional (Default value is provided, however can set at initialization time):

  • Port : FTP host port. Defaults to 21;

  • RemoteDirectory : path to FTP remote directory. Defaults to empty string, meaning that the default 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 sample Unity configuration is as below:


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 (Default value is provided, however can set at initialization time):

  • Port : FTP host port; 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. FileNamePattern property will be used to filter files to be deleted.

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