0
我使用int-sftp:入站通道适配器从远程目录下载文件。弹簧集成:int-sftp:入站通道适配器:如何检查源文件夹是否为空
我想检查远程目录是否为空,所以超时后,我停止下载和关闭应用程序。
那么如何检查远程目录是否为空以及如何使用超时?
我的源代码:
<int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
auto-startup="true" channel="receiveChannel" session-factory="sftpSessionFactory"
local-directory="file:${directory.files.local}" remote-directory="${directory.files.remote}"
auto-create-local-directory="true" delete-remote-files="true"
filename-pattern="*.txt" >
<int:poller
max-messages-per-poll="-1" error-channel="sftp.in.error.channel"/>
</int-sftp:inbound-channel-adapter>
感谢
我使用两个出站网关Shouls,每个命令一个? – NAZEHA
我可以使用带有命令“ls”的出站网关来检查目录是否为空,然后使用sftp入站适配器下载文件? – NAZEHA
每个网关处理单个命令[请参阅文档](http://docs.spring.io/spring-integration/reference/html/sftp.html#sftp-outbound-gateway)。是的,将'auto-startup'设置为false,并根据目录的内容,可以使用控制总线或直接获取对它的引用来启动适配器。 –