INT-4303: (S)FTP MGET with FileExistsMode.IGNORE

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

Don't emit ignored files in the output message payload.

Also, always preserve the timestamp when using `FileExistsMode.REPLACE_IF_MODIFIED`.

Some code style polishing
This commit is contained in:
Gary Russell
2017-06-23 11:16:04 -04:00
committed by Artem Bilan
parent 4679c9bdbe
commit 0903df9676
5 changed files with 36 additions and 10 deletions

View File

@@ -42,6 +42,7 @@
command="mget"
command-options="-f -P"
expression="payload"
mode="IGNORE"
local-directory-expression="@extraConfig.targetLocalDirectoryName + (#remoteDirectory ?: '')"
local-filename-generator-expression="#remoteFileName.replaceFirst('ftpSource', 'localTarget')"
reply-channel="output"/>

View File

@@ -228,6 +228,11 @@ public class FtpServerOutboundTests extends FtpTestSupport {
for (File file : localFiles) {
assertThat(file.getPath().replaceAll(Matcher.quoteReplacement(File.separator), "/"), containsString(dir));
}
this.inboundMGet.send(new GenericMessage<Object>(dir + "*.txt"));
result = this.output.receive(1000);
assertNotNull(result);
localFiles = (List<File>) result.getPayload();
assertThat(localFiles.size(), equalTo(0));
}
@Test