0

I am using this and Spring forum. The process works if remote directory is set as "foo" but it doesn't accept expression (foo/\*/*) that can read any number of files/folders under "foo". Completely lost!

    @Bean
public FtpInboundFileSynchronizer ftpInboundFileSynchronizer() {
    FtpInboundFileSynchronizer fileSynchronizer = new FtpInboundFileSynchronizer(ftpSessionFactory());
    fileSynchronizer.setDeleteRemoteFiles(false);
    fileSynchronizer.setRemoteDirectoryExpression(new LiteralExpression("foo/*/*"));
    fileSynchronizer.setFilter(new FtpSimplePatternFileListFilter("*.txt"));
    return fileSynchronizer;
}

Is there a library that can provide programmatic control to deal with (s)ftp operations that work well with spring(-boot). The documentation is huge, and for a FTP beginner like me, I'm not getting anywhere soon.

halfer
  • 19,824
  • 17
  • 99
  • 186
Divs
  • 1,578
  • 2
  • 24
  • 51

1 Answers1

1

You have to use an (S)FTP outbound gateway with a recursive MGET command for that. The inbound channel adapter (synchronizer) doesn't support pulling directory trees.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179