Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.

FTP Example

Available as of Camel 2.11

This example is located in the examples/camel-example-ftp directory of the Camel distribution.
There is a README.txt file with instructions how to run it.

About

This example demonstrates how Camel can upload and download files to/from an existing FTP server.

Prerequisites

An existing FTP server should be running.

Implementation

This example is implemented in Java code, and there is a client and a server application.

The client is used for uploading files from the local file system (from target/upload) to the FTP server.
The server is used for downloading files from the FTP server to the local file system (to target/download).

You can see the Java implementation by opening the src/main/java/org/apache/camel/example/ftp/MyFtpClientRouteBuilder.java for the client Java route.
And the server example is implemented in the src/main/java/org/apache/camel/example/ftp/MyFtpClientRouteBuilder.java file.

Running the example

You would need to configure the location and credential for the FTP server. This is done by editing the src/main/resources/ftp.properties file.
Byt default it connects to a non existing domain name, which you therefore must change.

Then you can either run the example as client or server by running from command line with Maven

mvn compile exec:java -Pclient

Or for the server

mvn compile exec:java -Pserver

Instructions is also printed to the console. And you can use ctrl + c to stop the Camel application.

If you encounter any problems you can enable verbose logging by following the instructions in the src/main/resources/log4j.properties file.

See Also

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram