veejay
veejay

Reputation: 27

How do I consume file which has date and time in it using Apache Camel?

I would like to consume file from a directory which matches the below pattern

File Pattern: InputFile_yymmdd_HHmmss.csv

How do I specify the pattern yymmdd_HHmmss in Apache Camel?

Please Note: I am not using XML based route in Camel. My sample code looks in the below mentioned format.

from("file:src/main/resources/csv/InputFile_yymmdd_HHmmss.csv").log(loggingLevel.INFO, "File Read")

Any sample code would solve my problem.

The route is not getting initialised when I use the above code

Upvotes: 0

Views: 471

Answers (1)

Strelok
Strelok

Reputation: 51481

Camel File component supports an include property that can define a regex pattern for files.

from("file:src/main/resources/csv?include=InputFile_\\d{6}_\\d{6}\.csv")
  .log(loggingLevel.INFO, "File Read")

Upvotes: 1

Related Questions