2017-04-11 96 views
0

我正在使用this和Spring論壇。如果遠程目錄設置爲「foo」,但它不接受可以讀取「foo」下任意數量的文件/文件夾的表達式(foo/*/*),則該過程可以工作。完全失去了!春季集成從動態多個目錄中讀取文件

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

有沒有可以提供的編程控制處理與彈簧(-boot)工作井(S)FTP操作的庫。這個文檔很大,對於像我這樣的新的蜜蜂來說,我很快就沒有辦法了。

一些幫助非常感謝!

回答

1

您必須使用(S)FTP outbound gateway以及遞歸MGET命令。入站通道適配器(同步器)不支持拉目錄樹。

+0

Thanks @Gary Russell。 – Divs

+0

有一個例子[這裏](http://stackoverflow.com/questions/42528316/how-polling-works-for-ftp-inbound-channel-adapter-considering-max-message-per-po/42535069#42535069) 。 –