The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

shankerj (1) [Avatar] Offline
#1
I am trying to read a file whose name has parts that I want to extract and store after a classification based on the name. For example:

a-b-c-d.ext should go to a/b/c/d.ext,
or a/b-c/d.ext or a variation of that nature.

If I use Java DSL, in to(file://), I am not able to tokenize.
I tried Groovy DSL (which is not documented in the book), by building a route in Groovy, but in "file://" string if I embed ${expression} as in GString, I don't get the request, in.headers in the context. How do I access them?

I can create a bean to return the tokenized string, but didn't want to create one for that.

Thanks in advance.
Shanker
davsclaus (413) [Avatar] Offline
#2
Re: Split filename and store
Hi Shanker

This forum is essentially for discussing the book.

If you have general Camel questions then I suggest to use the Camel forum / mailing list instead
http://camel.apache.org/discussion-forums.html
http://camel.apache.org/mailing-lists.html

Or use an alternative like stackoverflow
http://stackoverflow.com/questions/tagged/apache-camel

Those are better places to discuss this and more people to help out. I am also hanging out there.

/Claus