Skip to content

FTP2

This component provides access to remote file systems over the FTP and SFTP protocols.

For more information about FTP2: https://camel.apache.org/ftp2.html

Examples

Template: Dev_BaseRoute.groovy

Listener

Pull files from a SSHD server to the Platform 6 instance directory /opt/p6core.data/tmp/DLN.

${addRoutes} :=

from("sftp://test.amalto.io:2222/in?password=TEST&antInclude=*&move=../processed")
    .description('sFTP:test listener')
    .to("file:/opt/p6core.data/tmp")
    .threads(2,10)
    .to("p6cmb://scripts?platform6.request.action=execute&id=Handle_sFTP_Content")
    .routeId("mySFTPRoute")

${destroyRoutes} :=

p6.camel.destroyRoute('myFile2Route')

Producer

Expose all XML files over SFTP from the Platform 6 instance directory /opt/p6core.data/tmp/DLN and made them available on sftp://test.amalto.io:2222/in.

${addRoutes} :=

from("file:/opt/p6core.data/tmp/DLN?antInclude=*.xml&move=.processed")
    .description('FTP File Drop Processor')
    .to("sftp://test.amalto.io:2222/in?password=TEST")
    .routeId('myFile2Route')

${destroyRoutes} :=

p6.camel.destroyRoute('myFile2Route')