最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Spring integration smb - windows shared drive - not scanning sub directories - Stack Overflow

programmeradmin1浏览0评论

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
发布评论

评论列表(0)

  1. 暂无评论