You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Paul Anderson <pb...@gmualumni.org> on 2013/02/18 16:42:25 UTC

Path in file component using property value

I have a camel-context.xml file with a route that polls a directory.  I have
a property file that is being read and I would like to use a property from
it to set the directory.  First I tried this:

<from
uri="file://${PreOutDir}?delete=true&amp;include=..*\.info&amp;maxMessagesPerPoll=1&amp;sortBy=file:name"/>

where PreOutDir is my property name but I got a message saying

Dynamic expressions with ${ } placeholders is not allowed. Use the fileName
option to set the dynamic expression.

I tried this

<from
uri="file://?fileName=${PreOutDir}&amp;delete=true&amp;maxMessagesPerPoll=1&amp;include=..*\.info&amp;sortBy=file:name"/>

but that produced
Unknown function: PreOutDir at location 0
${PreOutDir}
*

This must be possible but the syntax is not clear...

I'm using Camel 2.10.1

Does anyone know a way?

Thanks!




--
View this message in context: http://camel.465427.n5.nabble.com/Path-in-file-component-using-property-value-tp5727738.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Path in file component using property value

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See this FAQ
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html

And this link as well
http://camel.apache.org/using-propertyplaceholder.html


On Mon, Feb 18, 2013 at 4:42 PM, Paul Anderson <pb...@gmualumni.org> wrote:
> I have a camel-context.xml file with a route that polls a directory.  I have
> a property file that is being read and I would like to use a property from
> it to set the directory.  First I tried this:
>
> <from
> uri="file://${PreOutDir}?delete=true&amp;include=..*\.info&amp;maxMessagesPerPoll=1&amp;sortBy=file:name"/>
>
> where PreOutDir is my property name but I got a message saying
>
> Dynamic expressions with ${ } placeholders is not allowed. Use the fileName
> option to set the dynamic expression.
>
> I tried this
>
> <from
> uri="file://?fileName=${PreOutDir}&amp;delete=true&amp;maxMessagesPerPoll=1&amp;include=..*\.info&amp;sortBy=file:name"/>
>
> but that produced
> Unknown function: PreOutDir at location 0
> ${PreOutDir}
> *
>
> This must be possible but the syntax is not clear...
>
> I'm using Camel 2.10.1
>
> Does anyone know a way?
>
> Thanks!
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Path-in-file-component-using-property-value-tp5727738.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen