The FTP component supports a local work folder directly.

See the localWorkDirectory option
http://camel.apache.org/ftp2

Then you can do

from(ftp:xxx?localWorkDirectory=/somepath").beanRef("parser", "convert").xxx?


On Mon, Oct 18, 2010 at 11:56 PM, Gustavo Franke
<[email protected]> wrote:
> Here's what I have in my RouteBuilder
>
> public void configure() {
>        String localWorkFolder = "/tmp/camel";
>        
> from("ftp://gust...@localhost:21/Test?password=gustavo&move=.processed";).to("file://"
> + localWorkFolder);
>        from("file://" + localWorkFolder + "?noop=true").beanRef("parser",
> "convert");
>        from("file:///tmp/camelout").to("ftp://gustavo
> @localhost:21/Test/out?password=gustavo&fileName=${file:onlyname}");
>    }
>
> I'm not sure if I am missing some thing but on the java app side the files
> are generated properly, those files should be copied to the ftp.
> But for some reason, on the ftp side the files are generated but its content
> is missing or corrupt, and I'm completely clueless regarding to this.
>
> If I don't explicit the &fileName=${file:onlyname} I get this error "Error
> writing file [Test/out/C:\tmp\camel\myFile.txt]" being Test/out the remote
> folder and C:\tmp\camel\myFile.txt path of the file. That's the reason why I
> added the &fileName=${file:onlyname} but I don't know why the content is
> missing.
>
> Any help would be great.
> Thanks,
> Gustavo
>



-- 
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

Reply via email to