簡體   English   中英

Spring Integeration SFTP出站網關mget -R問題

[英]Spring Integeration SFTP outbound gateway mget -R issue

我們正在嘗試使用spring集成[SFTP outbound-gateway]連接到SFTP服務器,以下載具有以下目錄表達式'/ * / * / foo /'的所有文件。 不幸的是,我們得到了不同的例外:

    Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:103)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:50)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.listFilesInRemoteDir(AbstractRemoteFileOutboundGateway.java:582)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.ls(AbstractRemoteFileOutboundGateway.java:551)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.mGetWithRecursion(AbstractRemoteFileOutboundGateway.java:753)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway.mGet(AbstractRemoteFileOutboundGateway.java:713)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway$3.doInSession(AbstractRemoteFileOutboundGateway.java:455)
at org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway$3.doInSession(AbstractRemoteFileOutboundGateway.java:451)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:334)
... 33 more
    Caused by: 2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2833)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2185)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2202)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1566)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1527)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:91)
... 41 more

我們正在使用以下內容:

<int-sftp:outbound-gateway session-factory="sftpFactory" request-channel="download"
        command="mget" command-options="-R" expression="'/*/*/foo/'" remote-file-separator="/" 
        local-directory-expression="'${local.dir}'+ #remoteDirectory" reply-channel="outputChannel"
        auto-create-local-directory="true" />

僅支持簡單的通配符,例如/foo/* -表示從/foo遞歸獲取-在這種情況下實際上不需要*/foo/將執行相同的操作。

但是,無法通配更高級別的目錄。

根據您的樹的復雜程度,您可能可以改用自定義過濾器-每次遞歸時都會調用該過濾器(列出每個目錄,應用過濾器,然后提取文件)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM