diff --git a/src/reference/asciidoc/ftp.adoc b/src/reference/asciidoc/ftp.adoc index a9aa7a958d..9d929cb9ef 100644 --- a/src/reference/asciidoc/ftp.adoc +++ b/src/reference/asciidoc/ftp.adoc @@ -430,13 +430,13 @@ public class FtpJavaApplication { public FtpInboundFileSynchronizer ftpInboundFileSynchronizer() { FtpInboundFileSynchronizer fileSynchronizer = new FtpInboundFileSynchronizer(ftpSessionFactory()); fileSynchronizer.setDeleteRemoteFiles(false); - fileSynchronizer.setRemoteDirectory("/"); + fileSynchronizer.setRemoteDirectory("foo"); fileSynchronizer.setFilter(new FtpSimplePatternFileListFilter("*.xml")); return fileSynchronizer; } @Bean - @InboundChannelAdapter(channel = "ftpChannel") + @InboundChannelAdapter(channel = "ftpChannel", poller = @Poller(fixedDelay = "5000")) public MessageSource ftpMessageSource() { FtpInboundFileSynchronizingMessageSource source = new FtpInboundFileSynchronizingMessageSource(ftpInboundFileSynchronizer()); @@ -483,11 +483,13 @@ public class FtpJavaApplication { return IntegrationFlows .from(s -> s.ftp(this.ftpSessionFactory) .preserveTimestamp(true) - .remoteDirectory("ftpSource") + .remoteDirectory("foo") .regexFilter(".*\\.txt$") .localFilename(f -> f.toUpperCase() + ".a") - .localDirectory(new File("d:\ftp_files")), - e -> e.id("ftpInboundAdapter").autoStartup(false)) + .localDirectory(new File("d:\\ftp_files")), + e -> e.id("ftpInboundAdapter") + .autoStartup(true) + .poller(Pollers.fixedDelay(5000))) .handle(m -> System.out.println(m.getPayload())) .get(); } diff --git a/src/reference/asciidoc/sftp.adoc b/src/reference/asciidoc/sftp.adoc index 39f6e0e0d6..08e27ab6e4 100644 --- a/src/reference/asciidoc/sftp.adoc +++ b/src/reference/asciidoc/sftp.adoc @@ -469,17 +469,17 @@ public class SftpJavaApplication { public SftpInboundFileSynchronizer sftpInboundFileSynchronizer() { SftpInboundFileSynchronizer fileSynchronizer = new SftpInboundFileSynchronizer(sftpSessionFactory()); fileSynchronizer.setDeleteRemoteFiles(false); - fileSynchronizer.setRemoteDirectory("/"); + fileSynchronizer.setRemoteDirectory("foo"); fileSynchronizer.setFilter(new SftpSimplePatternFileListFilter("*.xml")); return fileSynchronizer; } @Bean - @InboundChannelAdapter(channel = "sftpChannel") + @InboundChannelAdapter(channel = "sftpChannel", poller = @Poller(fixedDelay = "5000")) public MessageSource sftpMessageSource() { SftpInboundFileSynchronizingMessageSource source = new SftpInboundFileSynchronizingMessageSource(sftpInboundFileSynchronizer()); - source.setLocalDirectory(new File("ftp-inbound")); + source.setLocalDirectory(new File("sftp-inbound")); source.setAutoCreateLocalDirectory(true); source.setLocalFilter(new AcceptOnceFileListFilter()); source.setMaxFetchSize(1); @@ -521,12 +521,14 @@ public class SftpJavaApplication { public IntegrationFlow sftpInboundFlow() { return IntegrationFlows .from(s -> s.sftp(this.sftpSessionFactory) - .preserveTimestamp(true) - .remoteDirectory("sftpSource") - .regexFilter(".*\\.txt$") - .localFilenameExpression("#this.toUpperCase() + '.a'") - .localDirectory(this.sftpServer.getTargetLocalDirectory()), - e -> e.id("sftpInboundAdapter").autoStartup(false)) + .preserveTimestamp(true) + .remoteDirectory("foo") + .regexFilter(".*\\.txt$") + .localFilenameExpression("#this.toUpperCase() + '.a'") + .localDirectory(new File("sftp-inbound")), + e -> e.id("sftpInboundAdapter") + .autoStartup(true) + .poller(Pollers.fixedDelay(5000))) .handle(m -> System.out.println(m.getPayload())) .get(); }