You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2016/10/05 13:32:21 UTC

File Expression Language & date format

Do you think that a complete rejection of the parameters "idempotent"
corrects errors?
https://issues.apache.org/jira/browse/CAMEL-6574
https://issues.apache.org/jira/browse/CAMEL-6936

Enjoying http://camel.apache.org/file2.html
idempotentKey=${file:name}-${file:size}

Good. Enjoying http://camel.apache.org/file-language.html
file:modified - Refers to the file last modified returned as a Date type.

Look here http://people.apache.org/~dkulp/camel/simple.html
from("direct:hello").transform().simple("The today is ${date:now:yyyyMMdd}
and its a great day.").to("mock:reply");

I am interested in here is this part of the ${date:now:yyyyMMdd}
Writing
idempotentKey=${file:name}-${file:size}-${file:modified:yyyyMMdd}
I receive an error
Caused by:
org.apache.camel.language.simple.types.SimpleIllegalSyntaxException:
Unknown file language syntax: modified: yyyyMMdd at location 179

idempotentKey option generates a text string. To specify the date format?


Best regards,
Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/File-Expression-Language-date-format-tp5788388.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File Expression Language & date format

Posted by alexey-s <al...@mail.ru>.
Excuse me. Maybe I did not quite understand spoken. Or someone does not quite
understand.

On page http://camel.apache.org/file-language.html
file:modified	- Refers to the file last modified returned as a Date type.

Writing
idempotentKey=${file:name}-${file:size}-${file:modified} 
"file:modified" type is Long. Class GenericFile, field long lastModified;

If the "file:modified" is an introspection on the lastModified, then the
returned data type Long.
Or, do you want to do "file:modified" ==> new Date(file.getLastModified())


Best regards, 
Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/File-Expression-Language-date-format-tp5788388p5788477.html
Sent from the Camel - Users mailing list archive at Nabble.com.