You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tamil13 <ta...@gmail.com> on 2013/01/10 13:30:37 UTC
Creating dynamic folder
Hi. I want to create dynamic folder in dd-mm-yyyy based on some condition.
how can we do?
Below is the sample code.
<choice>
<when>
<simple>${file:onlyname.noext} contains ${properties:fileName1}
</simple>
<to uri="file:target/${date:now:yyyyMMdd}" />
</when>
<when>
<simple>${file:onlyname.noext} contains ${properties:fileName2}
</simple>
<to uri="file:target/${date:now:yyyyMMdd}" />
</when>
.
.
</choice>
but it shows error ${ } placeholders is not allowed. Use the fileName option
to set the dynamic expression.
--
View this message in context: http://camel.465427.n5.nabble.com/Creating-dynamic-folder-tp5725259.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Creating dynamic folder
Posted by tamil13 <ta...@gmail.com>.
Thank you very much. I owe you a lot.. It is working like a charm :-)
--
View this message in context: http://camel.465427.n5.nabble.com/Creating-dynamic-folder-tp5725259p5725267.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Creating dynamic folder
Posted by Andrea Tarocchi <an...@gmail.com>.
The error description explains the solution: "Use the fileName option
to set the dynamic expression."
Use fileName option for the dynamic part like this:
<to
uri=file:/d:/STATIC/PART/?fileName=${date:now:yyyy}/${date:now:MM}/${date:now:dd}/somthing.txt
/>
Andrea.
On Thu, Jan 10, 2013 at 1:30 PM, tamil13 <ta...@gmail.com> wrote:
>
> Hi. I want to create dynamic folder in dd-mm-yyyy based on some condition.
> how can we do?
> Below is the sample code.
> <choice>
> <when>
> <simple>${file:onlyname.noext}
> contains ${properties:fileName1}
> </simple>
> <to
> uri="file:target/${date:now:yyyyMMdd}" />
> </when>
> <when>
> <simple>${file:onlyname.noext}
> contains ${properties:fileName2}
> </simple>
> <to
> uri="file:target/${date:now:yyyyMMdd}" />
> </when>
> .
> .
>
> </choice>
>
> but it shows error ${ } placeholders is not allowed. Use the fileName
> option
> to set the dynamic expression.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Creating-dynamic-folder-tp5725259.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
"In a world without walls and fences who needs Windows and Gates?"