[ 
https://issues.apache.org/activemq/browse/CAMEL-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48355#action_48355
 ] 

Claus Ibsen commented on CAMEL-1198:
------------------------------------

A bit different but I got a little prototype working using spring in the 
camel-spring component.

What is needed is a bit nicer URI option for this, as you need to configure it 
as spring bean
{code:xml}
    <!-- START SNIPPET: example -->
    <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
        <template id="camelTemplate"/>

        <endpoint id="myFileEndpoint" 
uri="file://target/antpathmatcher?consumer.recursive=true&amp;filter=#myFilter"/>

        <route>
            <from ref="myFileEndpoint"/>
            <to uri="mock:result"/>
        </route>
    </camelContext>

    <bean id="myFilter" 
class="org.apache.camel.component.file.AntPathMatcherFilter">
        <property name="pattern" value="**/*day*"/>
    </bean>
    <!-- END SNIPPET: example -->
{code}

> Add pluggable File Scanning Strategies to file Poller - utilise Ant Scanning 
> as one
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-1198
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1198
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0.0
>            Reporter: Ramon Buckland
>            Assignee: Claus Ibsen
>            Priority: Minor
>
> Add the ability for the file scanner to have a pluggable finding 
> implementation.
> - Extract out the current method to one pluggable implementation
> - Add another which utilises the Ant DirectoryScanner
>    the Ant DirectoryScanner gives us the ability to scan more than one 
> directory tree at a time, having excludes and complex name location 
> strageties.
>    An example of this code in action is 
>    {code}
> DirectoryScanner dirScanner = new DirectoryScanner();
> dirScanner.setBasedir(myBaseDir);
> dirScanner.setIncludes(includes);  // String[]  -   { 
> "**/somedir/**/fileprefix*.csv","**/someother/dir/filepre*.txt"}
> dirScanner.setExcludes(excludes);
> ...
> dirScanner.scan();
> ..
> // work with files in dirScanner.getIncludedFiles()
>    {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to