【发布时间】:2015-04-29 12:30:03
【问题描述】:
感谢关注,我在 spring 集成项目中使用 ls 命令定义了 int-ftp:outbound-gateway 适配器,我想过滤 递归 .op ftp 中的扩展文件目录,我将file-pattern 设置为*.op 螺母不起作用,我的代码是:
<int-ftp:outbound-gateway id="gatewayLS"
session-factory="ftpSessionFactory"
request-channel="inbound"
command="ls"
filter="ftpFilter"
filename-pattern="*.op"
remote-directory=""
command-options="-R"
expression="payload"
reply-channel="toSplitter"/>
更新:
感谢@Gary 的帮助,我使用了filename-regex 选项而不是filename-pattern 到([foo]|.*\.op)(例如),它的工作。
对于过滤多个子目录,我们可以使用正则表达式([a-z]*|[a-z]*|.*\.op),它可以正常工作。
【问题讨论】:
-
那为什么要递归呢?这只会匹配当前目录中以
.op结尾的文件。**/*.op之类的东西可能会起作用(尽管我不确定是否完全支持 ant 样式表达式。 -
不,我们目前在这种情况下不支持任何样式的模式;请参阅我对算法的回答。
标签: spring ftp spring-integration