111.14. org.apache.camel.component.file.GenericFileFilter を使用するフィルター
Camel は、プラグイン可能なフィルタリング戦略をサポートしています。この戦略は、Java で org.apache.camel.component.file.GenericFileFilter
のビルドを使用することです。次に、そのようなフィルターを使用してエンドポイントを設定し、処理される前に特定のフィルターをスキップできます。
サンプルでは、ファイル名が report で始まるファイルのみを受け入れる独自のフィルターを作成しました。
そして、フィルター 属性を使用してルートを設定し、Spring XML ファイルで定義したフィルターを (#
表記を使用して) 参照できます。
<!-- define our sorter as a plain spring bean --> <bean id="myFilter" class="com.mycompany.MyFileFilter"/> <route> <from uri="ftp://someuser@someftpserver.com?password=secret&filter=#myFilter"/> <to uri="bean:processInbox"/> </route>