Filtering using ANT path matcher - 6.3

Talend ESB Mediation Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Design and Development
Talend ESB

The ANT path matcher is a filter that is shipped out-of-the-box in the camel-spring jar. So you need to depend on camel-spring if you are using Maven. The reason is that we leverage Spring's AntPathMatcher to do the matching.

The file paths are matched with the following rules:

  • ? matches one character

  • * matches zero or more characters

  • ** matches zero or more directories in a path

The sample below demonstrates how to use it:

<camelContext xmlns="">
   <template id="camelTemplate"/>
   <!-- use myFilter as filter to allow setting ANT paths for which -->
   <!-- filesto scan for -->
   <endpoint id="myFTPEndpoint" 

       <from ref="myFTPEndpoint"/>
       <to uri="mock:result"/>

<!-- we use the AntPathMatcherRemoteFileFilter to use ant paths for -->
<!-- includes and excludes -->
<bean id="myAntFilter" 
   <!-- include and file in the subfolder that has day in the name -->
   <property name="includes" value="**/subfolder/**/*day*"/>
   <!-- exclude all files with bad in name or .xml files. -->
   <!-- Use comma to separate multiple excludes -->
   <property name="excludes" value="**/*bad*,**/*.xml"/>