You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnanaguru S <gn...@wipro.com> on 2012/04/26 11:44:59 UTC

Read a file from network location

Hi

I am doing a simple file movement. 

My source file was in some remote location. How can I describe my shared
location in my camel route. 


Regards
Guru

--
View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667150.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Read a file from network location

Posted by Murari Raghavan <mu...@gmail.com>.
Gnanaguru:

As long as you have appropriate access to your endpoint, this should work.
[file://\\10.200.208.223\\share\\input]

Thanks,
Murari




--
View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5717667.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Read a file from network location

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 26, 2012 at 1:51 PM, Gnanaguru S
<gn...@wipro.com> wrote:
>
> hi Marco,
>
> The route is started.
>
> 2092 [org.apache.camel.spring.Main.main()] INFO
> org.apache.camel.spring.SpringCamelContext - Route: route1 sta
> rted and consuming from: Endpoint[file://\\10.200.208.223/share/input]
>
> But it doesnt work. :(
>

Camel uses the java.io.File API.

I suggest to create some standalone java app with a main method.
And then create a File instance with the path. And see if you can list
files, load a file etc from there.
Then you can thinker with it, and debug etc. To see what is going on.

And make sure you have access/privilege to read from the share etc.


> Regards
> Guru
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667374.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Read a file from network location

Posted by Gnanaguru S <gn...@wipro.com>.
hi Marco,

The route is started. 

2092 [org.apache.camel.spring.Main.main()] INFO
org.apache.camel.spring.SpringCamelContext - Route: route1 sta
rted and consuming from: Endpoint[file://\\10.200.208.223/share/input]

But it doesnt work. :(

Regards
Guru

--
View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667374.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Read a file from network location

Posted by Marco Westermann <Ma...@gmx.de>.
the file URI is file://

so the URL would look like

file://\\10.200.208.223/share/input

regards, marco



Am 26.04.2012 12:28, schrieb Gnanaguru S:
> Ya.
>
> Its not working.
>
> <from uri="file:\\\\10.200.208.223\\share\\input"/>
>
> This is how i specified.
>
> Regards
> Guru
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667219.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Read a file from network location

Posted by Gnanaguru S <gn...@wipro.com>.
Ya. 

Its not working. 

<from uri="file:\\\\10.200.208.223\\share\\input"/> 

This is how i specified.

Regards
Guru

--
View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667219.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Read a file from network location

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 26, 2012 at 11:44 AM, Gnanaguru S
<gn...@wipro.com> wrote:
> Hi
>
> I am doing a simple file movement.
>
> My source file was in some remote location. How can I describe my shared
> location in my camel route.
>

Whatever way that works with the java.io.File API.


>
> Regards
> Guru
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Read-a-file-from-network-location-tp5667150p5667150.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/