[
https://issues.apache.org/jira/browse/CAMEL-7047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-7047.
--------------------------------
Resolution: Invalid
Fix Version/s: 2.13.0
Assignee: Claus Ibsen
Please use the user mailing list / forum for getting help with your use-case.
Find more details here
http://camel.apache.org/support
http://camel.apache.org/mailing-lists.html
http://camel.apache.org/discussion-forums.html
> FTP
> ---
>
> Key: CAMEL-7047
> URL: https://issues.apache.org/jira/browse/CAMEL-7047
> Project: Camel
> Issue Type: Improvement
> Components: bean-integration
> Reporter: Biplab Sarkar
> Assignee: Claus Ibsen
> Priority: Minor
> Labels: performance, test
> Fix For: 2.13.0
>
>
> Hi,
> I am trying to ftp a particular file from a directory to a ftp location, so I
> followed the examples provided in camel 2.12.1, which polls for any file in
> the target directory specified, and whenever it finds the file it uploads in
> the ftp location mentioned in the properties file.
> How ever my requirement is i am writing a method which accepts the file name
> as an argument and sends that file name in the route builder, so that it
> uploads the only specified file name from the polling target directory.
> this is not working!
> public void toftp(String node_name,final String file_name) throws Exception {
>
> PropertiesComponent pc =
> getContext().getComponent("properties", PropertiesComponent.class);
>
> System.out.println("properties:"+getContext().getComponent("properties",
> PropertiesComponent.class));
> pc.setLocation("classpath:ftp.properties");
> System.out.println("properties location:"+pc.getLocations());
> context_sdp=new DefaultCamelContext();
> context_sdp.addComponent("properties", pc);
>
>
> if (node_name.equals("NODE_SDP")) {
>
> context_sdp.addRoutes(new RouteBuilder() {
>
> @Override
> public void configure() throws
> Exception{
> try{
> System.out.println("File name received
> is :"+file_name);
>
> fromF("file:target/upload?fileName=%s?moveFailed=../error",file_name)
> .log("Uploading file ${file:name}")
> .to("{{ftp.client.sdp}}")
> .log("Uploaded file ${file:name}
> complete.");
>
> } catch (Exception e
> ){System.out.println("error:"+e);}
> }
> });
> context_sdp.start();
> Thread.sleep(50000);
> context_sdp.stop();
> }
> This however works fine if i give
> fromF("file:target/upload?moveFailed=../error")
> this polls for any file in the target directory and tries to ftp when ever
> any file is put in the target directory.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)