INT-4304 (S)FTP Outbound Gateway Delete After GET

JIRA: https://jira.spring.io/browse/INT-4304

Add an option to delete remote file(s) after GET/MGET.

Polishing - log error on delete failure.
This commit is contained in:
Gary Russell
2017-06-23 15:38:03 -04:00
committed by Artem Bilan
parent a1c42f65d0
commit 5216dc2b02
6 changed files with 80 additions and 28 deletions

View File

@@ -833,10 +833,13 @@ The result of the _nlst_ is just the names, therefore the framework can't determ
_get_ retrieves a remote file and supports the following option:
* -P - preserve the timestamp of the remote file
* -P - preserve the timestamp of the remote file.
* -stream - retrieve the remote file as a stream.
* -D - delete the remote file after successful transfer.
The remote file is NOT deleted if the transfer is ignored because the `FileExistsMode` is `IGNORE` and the local file already exists.
The remote directory is provided in the `file_remoteDirectory` header, and the filename is provided in the `file_remoteFile` header.
The message payload resulting from a _get_ operation is a `File` object representing the retrieved file, or
@@ -888,11 +891,14 @@ You can either do that in your custom code, or route a copy of the message to a
_mget_ retrieves multiple remote files based on a pattern and supports the following options:
* -P - preserve the timestamps of the remote files
* -P - preserve the timestamps of the remote files.
* -R - retrieve the entire directory tree recursively
* -R - retrieve the entire directory tree recursively.
* -x - Throw an exception if no files match the pattern (otherwise an empty list is returned)
* -x - Throw an exception if no files match the pattern (otherwise an empty list is returned).
* -D - delete each remote file after successful transfer.
The remote file is NOT deleted if the transfer is ignored because the `FileExistsMode` is `IGNORE` and the local file already exists.
The message payload resulting from an _mget_ operation is a `List<File>` object - a List of File objects, each representing a retrieved file.

View File

@@ -855,10 +855,13 @@ The SFTP protocol doesn't provide _list names_ functionality, s this command is
_get_ retrieves a remote file and supports the following option:
* -P - preserve the timestamp of the remote file
* -P - preserve the timestamp of the remote file.
* -stream - retrieve the remote file as a stream.
* -D - delete the remote file after successful transfer.
The remote file is NOT deleted if the transfer is ignored because the `FileExistsMode` is `IGNORE` and the local file already exists.
The remote directory is provided in the `file_remoteDirectory` header, and the filename is provided in the `file_remoteFile` header.
The message payload resulting from a _get_ operation is a `File` object representing the retrieved file, or
@@ -910,11 +913,14 @@ You can either do that in your custom code, or route a copy of the message to a
_mget_ retrieves multiple remote files based on a pattern and supports the following options:
* -P - preserve the timestamps of the remote files
* -P - preserve the timestamps of the remote files.
* -R - retrieve the entire directory tree recursively
* -R - retrieve the entire directory tree recursively.
* -x - Throw an exception if no files match the pattern (otherwise an empty list is returned)
* -x - Throw an exception if no files match the pattern (otherwise an empty list is returned).
* -D - delete each remote file after successful transfer.
The remote file is NOT deleted if the transfer is ignored because the `FileExistsMode` is `IGNORE` and the local file already exists.
The message payload resulting from an _mget_ operation is a `List<File>` object - a List of File objects, each representing a retrieved file.

View File

@@ -176,6 +176,8 @@ The `RemoteFileTemplate` is supplied now with the `invoke(OperationsCallback<F,
New filters for detecting incomplete remote files are now provided.
The `FtpOutboundGateway` and `SftpOutboundGateway` now support an option to remove the remote file after a successful transfer using the `GET` or `MGET` commands.
See <<ftp>> and <<sftp>> for more information.
==== Integration Properties