首先感谢您的关注
我有一个spring集成项目,它监听ftp服务器接收不同目录下的文件并处理它,ftp目录结构是:
FTP根
-----------一个\
-----------------在\
--------------------------- A.TXT
-----------------出\
------------ b \
-----------------在\
--------------------------- b.txt
-----------------出\
我使用int-ftp:outbound-gateway
适配器来运行ls recursive命令,如何在expression
中编写int-ftp:outbound-gateway
attr来获取 a.txt 和 b。在 in
目录中的txt ,我的适配器代码为:
<int-ftp:outbound-gateway id="gateway1"
session-factory="ftpClientFactory"
request-channel="inbound1"
reply-channel="outbound"
reply-timeout="777"
auto-create-local-directory="false"
auto-startup="true"
command="ls"
command-options="-1 -R"
expression="'*/in/'"
mput-regex=".*">
</int-ftp:outbound-gateway>
但没有正确使用,怎么写?
答案 0 :(得分:1)
看起来MGET
操作适合您:
<int-ftp:outbound-gateway id="gatewayLS"
session-factory="ftpSessionFactory"
request-channel="inbound"
command="mget"
command-options=""
expression="payload"
local-directory="/tmp/out"
reply-channel="resultChannel"/>