You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rwijngaa <ri...@gmail.com> on 2015/08/17 10:51:38 UTC

Cannot use ${file:xx} in blueprint route / properties

Hi,

I noticed that i cannot use things like ${file:name} or ${date:now} in my
blueprint route that uses a OSGI config file (the value stays empty)

E.g.


I got this in the /etc/com.example.myconfig.cfg


The {{ }} works ok, how can i make the ${file:xx} work ?

I'm using Camel 2.15.




--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by rwijngaa <ri...@gmail.com>.
Thanks, 
  it took 8 backslashes to make it work. This looks ridiculous ;-)

   file:\\\\\\\\{{example.host}}




--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770782.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by Pontus Ullgren <ul...@gmail.com>.
Probably due to how escaping the backslash is handled when using property
placeholder.
Try adding additional backslash to escape the backslashes in the config
file.
So
example.endpoint = file:\\\\\\example.host.com

Also note that using the file component to access windows shares only work
when running on windows and the access will be done using the user the
camel process is running as.
This might lead to problems when running the application as a service as
oppose to when you run it as your self during development.

Perhaps you should take a look at the camel-jcifs component in the
camel-extra project.
https://camel.apache.org/jcifs.html

Best regards
Pontus

On Mon, 17 Aug 2015 at 16:06 rwijngaa <ri...@gmail.com>
wrote:

> On a related note (an maybe blueprint related)
>
> example.endpoint = file:\\\\example.host.com
>
> <from uri="{{example.endpoint}}" />
> => Does not work: creates folder in root of c:\  named example.host.com
> and
> reads from that
>
> <from uri="file:\\\\example.host.com" />
> => Works / reads from windows share example.host.com
>
>
> Any ideas on this? Should i try spring based routes here or is this sort of
> property usage
> not supported?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770770.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by rwijngaa <ri...@gmail.com>.
On a related note (an maybe blueprint related)

example.endpoint = file:\\\\example.host.com

<from uri="{{example.endpoint}}" />
=> Does not work: creates folder in root of c:\  named example.host.com  and
reads from that

<from uri="file:\\\\example.host.com" />
=> Works / reads from windows share example.host.com


Any ideas on this? Should i try spring based routes here or is this sort of
property usage
not supported?



--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770770.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by rwijngaa <ri...@gmail.com>.
Thanks Claus, that worked!



--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by Claus Ibsen <cl...@gmail.com>.
See the alternative syntax at
http://camel.apache.org/simple

On Mon, Aug 17, 2015 at 10:51 AM, rwijngaa
<ri...@gmail.com> wrote:
> Hi,
>
> I noticed that i cannot use things like ${file:name} or ${date:now} in my
> blueprint route that uses a OSGI config file (the value stays empty)
>
> E.g.
>
>
> I got this in the /etc/com.example.myconfig.cfg
>
>
> The {{ }} works ok, how can i make the ${file:xx} work ?
>
> I'm using Camel 2.15.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Re: Cannot use ${file:xx} in blueprint route / properties

Posted by rwijngaa <ri...@gmail.com>.
More specific:

This works:


When you include tempFileName=tempTransfer/${file:name} in the 
cfs.defaultWriteOptions property, than this does not work:





--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-use-file-xx-in-blueprint-route-properties-tp5770764p5770765.html
Sent from the Camel - Users mailing list archive at Nabble.com.