HOW:Apache的骆驼,正则表达式匹配的文件 [英] HOW: Apache Camel, Regex match files

查看:188
本文介绍了HOW:Apache的骆驼,正则表达式匹配的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯在让骆驼做一些文件操作,并通过ActiveMQ代理通过他们,香港专业教育学院尝试采取这个项目在从一个人谁最近退出了。

im experimenting in getting camel to do some file operations and pass them through the activeMQ broker, ive taken this project over from a guy who recently quit.

什么香港专业教育学院走到这一步:

what ive got so far:

    <route id="SVLFTPCOPY">
  <from uri="sftp://*****:*******@********/srv/test/?fileName=*2280.xls&amp;noop=true&amp;idempotent=false"/>
    <to uri="file:/srv/data/test/destination/"/>
    <to uri="activemq:queue:svl.ftp.copy"/>
    </route>

它的工作原理到它运行的路线没有抛出任何错误了点,但还是犯规将文件复制到本地文件。

it works to the point where it runs the route without throwing any errors, but still doesnt copy the file to the local file.

任何想法?

推荐答案

是的,你需要的,如果你想筛选出基于模式的文件使用包含/排除/过滤选项。 filename选项是对的的文件。

Yeah you need to use the include/exclude/filter option if you want to filter out files based on patterns. The fileName option is for a single file.

所以你的情况,删除filename选项,用替换它包括= * 2280.xsl 。记住,包括基于Java的正前pressions,所以我们使用的点星的指示通配符。更多细节在这里: http://camel.apache.org/file2 。该FTP组件继承的文件组件的选项99%,所以这就是为什么我指的是文件的维基页面。

So in your case, remove fileName option and replace it with include=.*2280.xsl. Mind that the include is based on Java regular expressions, so we use dot star to indicate wildcard. More details here: http://camel.apache.org/file2. The ftp component inherits 99% of the options of the file component, so that is why I refer to the file wiki page.

这篇关于HOW:Apache的骆驼,正则表达式匹配的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆