【发布时间】:2016-06-27 06:23:53
【问题描述】:
根据http://docs.spring.io/spring-integration/reference/html/ftp.html#ftp-outbound-gateway,mget payload 是一个文件列表
mget 基于模式检索多个远程文件,并支持以下选项:
...
mget 操作产生的消息负载是一个 ListFile> 对象 - 一个文件对象列表,每个对象代表一个检索到的文件。
我有以下配置
<int-ftp:outbound-gateway
session-factory="ftpSesionFactory"
request-channel="request-channel"
reply-channel="reply-channel"
auto-create-directory="true"
local-directory="${local-directory}"
command="mget"
command-options="-stream"
expression="payload">
<int-ftp:request-handler-advice-chain>
<int:retry-advice />
</int-ftp:request-handler-advice-chain>
</int-ftp:outbound-gateway>
<int-file:splitter input-channel="reply-channel" output-channel="logger"/>
但有效载荷是一个 ListFTPFile> 并且拆分器不起作用。这是一个错误吗?如何在有效负载中获取下载的 Listjava.io.File>(如文档所述)?。
解决方法是使用另一个组件从本地目录读取文件,如how to get file with int-ftp:outbound-gateway and remove from server if exists? 所述。
我正在使用 spring-integration 4.2.5 和 commons-net-2.0。
【问题讨论】:
标签: spring-integration apache-commons-net