- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试获取 3 层深的目录结构中的所有文件。
例如:
- 图像 a.jpg 存在于文件夹/images/12/34/
- 图像 b.jpg 存在于文件夹/images/56/78
我已经尝试过如下所述的出站网关:
https://github.com/spring-projects/spring-integration-samples/blob/master/basic/ftp/src/test/resources/META-INF/spring/integration/FtpOutboundGatewaySample-context.xml
and
http://forum.spring.io/forum/spring-projects/integration/104612-inbound-ftp-polling-sub-directories?p=604430#post604430
我的配置:
<bean id="ftpSessionFactory"
class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<property name="host" value="127.0.0.1"/>
<property name="port" value="21"/>
<property name="username" value="Administrator"/>
<property name="password" value="SgtSpeedy1"/>
<property name="fileType" value="2"/>
<property name="clientMode" value="2" />
</bean>
<int-ftp:outbound-gateway id="gatewayLS"
cache-sessions="false"
session-factory="ftpSessionFactory"
request-channel="inbound"
command="ls"
command-options=""
expression="'/images/*/*'"
reply-channel="toSplitter"/>
<int:channel id="toSplitter" />
<int-stream:stdout-channel-adapter channel="toSplitter" append-newline="true"/>
我省略了拆分器,只是为了测试目的打印了所有内容。
测试时,我没有得到任何文件。我尝试将文件夹设置为/images/* 然后它返回“图像”文件夹下的所有图像,但不是如提供的链接中所述递归。因此不考虑文件夹/12/34 和/56/78。
我看不到我错过了什么。谁能帮忙?
附言我正在使用 Spring Integration 2.2.6,但没有升级到 4.0.2(最新)的选项,因为我使用的是框架。否则我会为网关使用 -R 选项!
最佳答案
我刚刚用 foo/foo/bar/qux.txt
和 foo/foo/baz/fiz.txt
测试了
<int-ftp:outbound-gateway id="gatewayLS"
session-factory="ftpSessionFactory"
request-channel="inbound"
command="ls"
command-options="-1"
expression="'foo/*/*'"
reply-channel="toSplitter"/>
而且效果很好;正如预期的那样......
11:34:55.983 DEBUG [main] ...[Payload ArrayList content=[fiz.txt, qux.txt]]...
(我添加了 -1 选项以仅获取文件名)。
这是在服务器端使用 linux ftpd。
您确定文件在 /images
而不是 images
中吗? (或者用户是否已 chroot,所以 /
是他的家)?
关于java - Spring Integration 使用出站网关递归获取 FTP 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23994944/
前不久,哔哩哔哩(一般常称为 B 站)发布了一篇文章《2021.07.13 我们是这样崩的》,详细回顾了他们在 2021.07.13 晚上全站崩溃约 3 小时的至暗时刻,以及万分紧张的故障定位与恢复过
想象一下这种情况,周围有一些智能手机和计算机,它们的 WiFi 适配器(无线适配器)打开,但没有必要连接到网络。 有没有办法通过 Linux 机器查看 MAC 地址? 任何见解表示赞赏。 最佳答案 断
我无法创建新的 Window Station 来运行我的应用程序 int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { wprintf(L"
在 Conda 环境中安装包后,我想对该包中的代码进行一些更改。 在哪里可以找到包含已安装包的 site-packages 目录? 我有 Anaconda Python 2.7 base 发行版,但找
今天去改了matplotlib的配置。搜索 matplotlibrc 发现我有两个: 查看site-packages 文件夹,我发现很多包的名称中都有波浪号: ~klearn 是 sklearn ,但
我是一名优秀的程序员,十分优秀!