简体   繁体   English

Spring Integeration SFTP出站网关mget -R问题

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

we are trying to connect to SFTP server using spring integration [SFTP outbound-gateway] to download all files with the following directory expression '/*/*/foo/' . 我们正在尝试使用spring集成[SFTP outbound-gateway]连接到SFTP服务器,以下载具有以下目录表达式'/ * / * / foo /'的所有文件。 unfortunately we are getting different exceptions : 不幸的是,我们得到了不同的例外:

    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

we are using the following : 我们正在使用以下内容:

<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" />

Only simple wildcards are supported, such as /foo/* - meaning fetch recursively from /foo - the * is actually not needed in this case, /foo/ will do the same thing. 仅支持简单的通配符,例如/foo/* -表示从/foo递归获取-在这种情况下实际上不需要*/foo/将执行相同的操作。

But, there's no way to wild-card higher level directories. 但是,无法通配更高级别的目录。

Depending on how complex your tree is, you might be able to use a custom filter instead - the filter is invoked during each recursion (where each directory is listed, filter applied, then files fetched). 根据您的树的复杂程度,您可能可以改用自定义过滤器-每次递归时都会调用该过滤器(列出每个目录,应用过滤器,然后提取文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring-Integeration SFTP网关用于Mput操作 - Spring-Integeration SFTP Gateway for Mput Operation 设置 Spring Integration SFTP 出站网关时出现 UnsatisfiedDependencyException - UnsatisfiedDependencyException when setting up a Spring Integration SFTP outbound gateway 如何从 Spring 的组件中调用配置中的 SFTP 出站网关操作 - How to call SFTP Outbound Gateway operations in Configuration from Component in Spring Spring SFTP出站网关:如何在Java Config中关闭GET后的会话? - Spring SFTP Outbound Gateway: How to close the session after GET in Java Config? 在第一个“找不到文件”问题之后,Sftp出站网关多个删除请求被卡住了 - Sftp Outbound Gateway multiple delete request getting stuck after first “File not found” issue 将文件/文件从远程目录移动到另一个 Spring 集成 SFTP 出站网关 Java 配置/Java DSL - Moving file/files from remote directory to another Spring Integration SFTP Outbound Gateway Java Config/Java DSL Spring 使用入站适配器消息处理程序中的出站网关的 Sftp 获取文件 - Spring Sftp fetch file using outbound gateway within inbound adapter message handler 如何使用多个sftp出站网关 - How to use multiple sftp outbound-gateway spring http出站网关定制 - spring http outbound gateway customization 带有删除的SFTP Outbound的Spring Integration DSL - Spring Integration DSL for SFTP Outbound with delete
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM