You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ankelee <an...@gmail.com> on 2010/03/24 11:52:56 UTC

Problems with paths.

Hi - this might not be strictly Camel question but here goes:

I'm having some problems finding handling different paths when working with
files in Camel:

from("file://data/in/inbox?move=data/in/backup/${date:now:yyyyMMddhh}/${file:name}")...etc

I have a standard Eclipse project with /bin and /src. Next to these i have
/data, /settings and /schemas.

So, when I run the above route Camel reads from the correct directory but
then wants to create from the read position, so I get
/data/in/inbox/data/in/backup/etc instead og /data/in/inbox. This can be
corrected with ../../../ but that's not really elegant - what to do?

I'm also trying to use the new PropertiesComponent in Camel 2.3.0 and I have
troubles reaching the correct directory there too.

PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("settings/opsigclient.properties");

This is not working I get an exception saying that this directory cannot be
found on the classpath. It works if I move the settings directory inside the
java-package where the .class files are placed.
-- 
View this message in context: http://old.nabble.com/Problems-with-paths.-tp28013388p28013388.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problems with paths.

Posted by Claus Ibsen <cl...@gmail.com>.
The move options is relative to where the file was picked up. But the
game changes when you use ${ }

Read more at - Fine grained control over Move and PreMove option
http://camel.apache.org/file2.html


On Wed, Mar 24, 2010 at 11:52 AM, ankelee <an...@gmail.com> wrote:
>
> Hi - this might not be strictly Camel question but here goes:
>
> I'm having some problems finding handling different paths when working with
> files in Camel:
>
> from("file://data/in/inbox?move=data/in/backup/${date:now:yyyyMMddhh}/${file:name}")...etc
>
> I have a standard Eclipse project with /bin and /src. Next to these i have
> /data, /settings and /schemas.
>
> So, when I run the above route Camel reads from the correct directory but
> then wants to create from the read position, so I get
> /data/in/inbox/data/in/backup/etc instead og /data/in/inbox. This can be
> corrected with ../../../ but that's not really elegant - what to do?
>
> I'm also trying to use the new PropertiesComponent in Camel 2.3.0 and I have
> troubles reaching the correct directory there too.
>
> PropertiesComponent pc = new PropertiesComponent();
> pc.setLocation("settings/opsigclient.properties");
>
> This is not working I get an exception saying that this directory cannot be
> found on the classpath. It works if I move the settings directory inside the
> java-package where the .class files are placed.
> --
> View this message in context: http://old.nabble.com/Problems-with-paths.-tp28013388p28013388.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus