Below code is only copying the files from the (windows shared drive)remote directory but all the sub directories of remote directory are skipped. I don't understand why the sub directories are skipped.
@Bean
public IntegrationFlow smbInboundFlow() {
RecursiveDirectoryScanner scanner = new RecursiveDirectoryScanner();
ChainFileListFilter filter = new ChainFileListFilter<>(
Arrays.asList( new SmbRegexPatternFileListFilter("(.*/)*.*")));
scanner.setFilter(filter);
scanner.setMaxDepth(5);
return IntegrationFlow
.from(Smb.inboundAdapter(smbSessionFactory())
.preserveTimestamp(true)
.remoteDirectory("./")
.scanner(scanner)
.localDirectory(new File("./tmp/copyfolder")),
e -> e.id("smbInboundAdapter")
.autoStartup(true)
.poller(Pollers.fixedDelay(400)))
.handle(m -> {
System.out.println(m.getPayload());})
.get();
}
Remote Dir(Windows shared drive):
.
├── file1.txt
├── file2.txt
├── file3.txt
└── subdir
├── file4.txt
├── file5.txt
└── file6.txt
My local dir content(/tmp/copyfolder):
.
├── file1.txt
├── file2.txt
├── file3.txt