apache-camel file2 antInclude ignore-case

1.9k views Asked by At

I need to poll a directory and narrow the files with a case insentive expression.

With version 2.10 camel adds support for antInclude which is what I look into, unfortunately antInclude is case sensitive, so are other filtering expressions. Implementing GenericFileFilter is not an option, since the filtering patterns are not known at compile time as I read them from database at runtime and I have multiple file rules each with a different pattern.

I programmatically create several routes in a loop, where each file route has a different case insensitive filtering pattern. I would appreciate if camel file component supports case insensitive expressions, or is there any other way without creating myself a new file component in camel?

public class MyRouter extends RouteBuilder {

@Override
public void configure() throws Exception {
    Vector<FileTransferEntity> list = TransferDAO.getTransferList();
    for(FileTransferEntity t : list) {
        fromF("ftp://ftpuser@ftpserver/some-directory?antInclude=%s", t.getFileMask()).
        toF("mock:result");//depending on t, action will change.
    }
}
1

There are 1 answers

1
Ben ODay On