user7916020
user7916020

Reputation: 109

how to inject the route into camel FileFilter

Is there a way to inject the route into camel FileFilter ? I have this camel route :

<route id="mislaka-bituch">
                    <from
                           uri="ftp://{{mislaka_bituch_in_path}}?filter=#fileFilter&amp;readLock=none&amp;delete=true&amp;moveFailed=.error&amp;sortBy=file:modified" />
                    <convertBodyTo type="java.lang.String" />
                    <to uri="bean:redirectService?method=analyzeMislaka" />
                    <toD uri="ftp://${exchangeProperty[targetPath]}" />
             </route>

And in my FileFilter I have the method :

public boolean accept(GenericFile<T> file)

But how do i get the route info (name for example) in this class ?

Upvotes: 0

Views: 300

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55750

Yes as said in the comments, you cannot get the id of the route etc, in the FileFilter method, you can only get file information from the GenericFile.

Upvotes: 1

Related Questions