Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 如何覆盖本地文件并使用int ftp:outbound gateway从服务器中删除?_Spring_Ftp_Spring Integration - Fatal编程技术网

Spring 如何覆盖本地文件并使用int ftp:outbound gateway从服务器中删除?

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"

首先感谢大家的关注 在我的spring集成项目中,我使用int ftp:outbound gateway adapter在ftp服务器上运行命令,我想从服务器检索文件并替换为本地文件(如果存在),否则创建新文件,并将其从服务器上删除,我编写了适配器代码以执行操作,但无法正常工作,我的代码是:

 <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