Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache camel s3 component - specify suffix / regex on prefix

I'm using the aws s3 component of Apache Camel. And I want to consume specific data only with an extension of .txt, how can this be achieved? According to camel documentation, it has a prefix options which is not suitable in my case since i want to filter based on extensions.

TIA

like image 682
lorraine Avatar asked Feb 19 '14 09:02

lorraine


1 Answers

No there is no way to do this.

You cannot use a regular expression in the prefix option as it is just a string, see http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/ListObjectsRequest.html#setPrefix(java.lang.String)

The only way would be to retrieve a list of the files and filter them. Or name the files in such a way so that you can use a prefix

like image 194
Matthew Wilson Avatar answered Nov 10 '22 06:11

Matthew Wilson