camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Biplab Sarkar (JIRA)" <>
Subject [jira] [Created] (CAMEL-7047) FTP
Date Sun, 08 Dec 2013 07:28:35 GMT
Biplab Sarkar created CAMEL-7047:

             Summary: FTP
                 Key: CAMEL-7047
             Project: Camel
          Issue Type: Improvement
          Components: bean-integration
            Reporter: Biplab Sarkar
            Priority: Minor


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

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));
	    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() {
					public void configure() throws Exception{
					System.out.println("File name received is :"+file_name);
					.log("Uploading file ${file:name}")
					.log("Uploaded file ${file:name} complete.");
				}  catch (Exception e ){System.out.println("error:"+e);}

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

View raw message