Spring Book – Chapter 20 – Spring Integration

FTP, FTPS and SFTP

Spring Integration allows sending and receiving files to and from a server using File Transfer Protocol (FTP), FTP Secure (FTPS), and Secure File Transfer Protocol (SFTP).

Below, Listing 22-42 and Listing 22-43 shows maven dependency required for integrating FTP and SFTP respectively using Spring Integration.

Listing 22-42. Maven dependency required for FTP integration using Spring Integration

Listing 22-43. Maven dependency required for SFTP integration using Spring Integration

Below, Listing 22-44 and Listing 22-45 shows declaration of Spring Integration namespace for FTP and SFTP respectively in the Spring configuration file.

Listing 22-44. Declaration of FTP namespace in Spring configuration file

Listing 22-45. Declaration of SFTP namespace in Spring configuration file

Below, Listing 22-46 and Listing 22-47 shows declaration of inbound channel adapter for FTP and SFTP respectively using Spring Integration in the Spring configuration file.

Listing 22-46. Declaration of FTP inbound channel adapters in Spring configuration file

Listing 22-47. Declaration of SFTP inbound channel adapters in Spring configuration file

Below, Listing 22-48 and Listing 22-49 shows declaration of outbound channel adapter for FTP and SFTP respectively using Spring Integration in the Spring configuration file.

Listing 22-48. Declaration of FTP outbound channel adapters in Spring configuration file

Listing 22-49. Declaration of SFTP outbound channel adapters in Spring configuration file

Listing 22-50. FTP/SFTP configuration file ftp.properties

The only difference using FTPS is the declaration of FTPS session factory as shown in Listing 22-51 below.

Listing 22-51. FTPS session factory configured as Spring bean

Page Visitors: 13313

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

2 thoughts on “Spring Book – Chapter 20 – Spring Integration

  1. Hi,
    Thanks for this blog and information sharing!
    I have one question from Spring Integration. Just thought of checking with you.
    I have SimplewebserviceOutBoundGateway. I need to send a document / attachment to the webservice. How will i achieve that?
    This is my current gateway configuration:

    Please let me know, if you can throw some light in this area.
    Thanks in Advance!

  2. Hi,
    Thank you for your information sharing.
    I have one doubt,could you please suggest me the correct frameworks to address that issue.

    My requirement is I would like to get and process files using spring and camel.

    Thanks,
    Madhu

Leave a Reply

Your email address will not be published. Required fields are marked *