camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Ravindra.Godb...@cognizant.com>
Subject RE: download files for each xml entry
Date Tue, 25 Mar 2014 09:08:45 GMT
Here is what you can do .


                               from("direct:start")
                            .to("http://localhost/Files.xml")
                            .split(xpath("//file/text()")).parallelProcessing()
                            .process(new  Processor() {

                                                @Override
                                                public void process(Exchange exchange) throws
Exception {
                                                        String fileName  = exchange.getIn().getBody(String.class);

                                                        // Invoke copy functionality based
on the protocol [ local or remote ]
                                                }
                                        });

Where Files.xml looks like this..

<files>
        <file>D:\test1.xml</file>
        <file>D:\test3.xml</file>
        <file>D:\test4.xml</file>
</files>
- Ravi



-----Original Message-----
From: sb.append [mailto:a261427@drdrb.net]
Sent: Monday, March 24, 2014 6:51 PM
To: users@camel.apache.org
Subject: download files for each xml entry

Hello,

I've simple task to parse xml entries containing links to files. For each entry the file should
be downloaded. Is the following route a correct approach?

        from("direct:start")
            .to("http://address.of.xml")
            .filter()
            .xpath("entry/link")
            .to(body())
            .to("file:input);

I'd like to add parallel download later too.





--
View this message in context: http://camel.465427.n5.nabble.com/download-files-for-each-xml-entry-tp5749276.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s)
and may contain confidential and privileged information. If you are not the intended recipient(s),
please reply to the sender and destroy all copies of the original message. Any unauthorized
review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or
any action taken in reliance on the contents of this e-mail is strictly prohibited and may
be unlawful.

Mime
View raw message