Spring 如何在int-ftp:带表达式的出站网关中获取子目录?

Spring 如何在int-ftp:带表达式的出站网关中获取子目录?,spring,ftp,spring-integration,Spring,Ftp,Spring Integration,首先感谢大家的关注 我有一个spring集成项目,它监听ftp服务器接收不同目录中的文件并进行处理,ftp目录结构是: ftp根目录 -----------a\ -----------------在\ ---------------------------a、 txt -----------------out\ ------------b\ -----------------在\ ---------------------------b、 txt -----------------出去\ 我使用

首先感谢大家的关注 我有一个spring集成项目,它监听ftp服务器接收不同目录中的文件并进行处理,ftp目录结构是:
ftp根目录
-----------a\
-----------------在\
---------------------------a、 txt
-----------------out\
------------b\
-----------------在\
---------------------------b、 txt
-----------------出去\

我使用
int-ftp:outbound-gateway
adapter来运行ls递归命令,如何在
int-ftp:outbound-gateway
中编写
expression
attr,在
目录中获取a.txt和b.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>


但工作不正确,如何编写?

看起来像是
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"/>


.

是的,没错,如何编写只获取子目录的
表达式
attr,将
表达式
设置为
/*/in/
但不正确workedIt不起作用。请阅读我指出的文件。您确实需要
filter
来跳过文件,从而跳过不需要的dir,适配器已被更改,但引发了以下异常
org.springframework.messaging.MessagingException:;嵌套异常为org.springframework.messaging.MessaginException:无法在会话上执行;嵌套异常为java.lang.IllegalArgumentException:路径不能为null
感谢帮助我您没有尝试在请求消息中使用
*
作为路径吗?它在@Artem