Spring 如何覆盖本地文件并使用int ftp:outbound gateway从服务器中删除?
首先感谢大家的关注 在我的spring集成项目中,我使用int ftp:outbound gateway adapter在ftp服务器上运行命令,我想从服务器检索文件并替换为本地文件(如果存在),否则创建新文件,并将其从服务器上删除,我编写了适配器代码以执行操作,但无法正常工作,我的代码是:Spring 如何覆盖本地文件并使用int ftp:outbound gateway从服务器中删除?,spring,ftp,spring-integration,Spring,Ftp,Spring Integration,首先感谢大家的关注 在我的spring集成项目中,我使用int ftp:outbound gateway adapter在ftp服务器上运行命令,我想从服务器检索文件并替换为本地文件(如果存在),否则创建新文件,并将其从服务器上删除,我编写了适配器代码以执行操作,但无法正常工作,我的代码是: <int:channel id="inbound1"/> <int-ftp:outbound-gateway id="gatewayGet"
<int:channel id="inbound1"/>
<int-ftp:outbound-gateway id="gatewayGet"
session-factory="ftpClientFactory"
request-channel="inbound1"
reply-channel="outbound"
reply-timeout="777"
mode="REPLACE"
auto-create-local-directory="true"
command="mget"
command-options="-R"
expression="payload"
filename-pattern="*"
local-directory-expression="'./backup/' +#remoteDirectory">
</int-ftp:outbound-gateway>
<int-ftp:outbound-gateway id="gatewayRM"
session-factory="ftpClientFactory"
request-channel="outbound"
reply-channel="outboundRemoved"
reply-timeout="777"
command="rm"
expression="headers['file_remoteDirectory'] + '/' + headers['file_remoteFile']"
>
</int-ftp:outbound-gateway>
<int:channel id="outbound">
<int:interceptors>
<int:wire-tap channel="logger"/>
</int:interceptors>
</int:channel>
<int:channel id="outboundRemoved">
<int:interceptors>
<int:wire-tap channel="logger"/>
</int:interceptors>
</int:channel>
我可以在检查有效负载时接收消息,如果存在文件发送到删除通道吗
org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is java.io.IOException: Failed to delete '//'. Server replied with: 550 File not found