Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Spring FTP using an outbound channel example


In this section, lets look at a simple scenario of transferring files from Location1 to a remote location, Location2. For the sake of clarity, let's define them as follows:

  • Location1: d:\folder1

  • Location2: d:\folder2

Let's create a simple application in Spring with the Spring integration package, to accomplish the task of transferring files from Location1 to Location2. We need to have two main files to do this; the first one is the configuration file applicationContext.xml and the second is a Java class file that will intimate the Spring integration framework to upload the file to the remote location.

The applicationContext.xml file will have the entire necessary bean configuration with XMLNS required to use Spring integration package. The XMLNS that needs to be integrated is as follows:

  xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"

We also need to configure...