<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:si="http://www.springframework.org/schema/integration"
	   xmlns:ftp="http://www.springframework.org/schema/integration/ftp"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans
			https://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/integration
			https://www.springframework.org/schema/integration/spring-integration.xsd
			http://www.springframework.org/schema/integration/ftp
			 https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd">


	<si:chain input-channel="outboundChainChannel">
		<ftp:outbound-channel-adapter
				auto-create-directory="true"
				session-factory="ftpSessionFactory"
				remote-directory="remote-target-dir"/>
	</si:chain>

	<bean id="ftpSessionFactory"
		  class="org.springframework.integration.ftp.outbound.FtpOutboundTests$TestFtpSessionFactory">
		<property name="username" value="kermit"/>
		<property name="password" value="frog"/>
		<property name="host" value="foo.com"/>
	</bean>

	<si:channel id="output">
		<si:queue/>
	</si:channel>

	<si:chain input-channel="ftpOutboundGatewayInsideChain" output-channel="output">
		<ftp:outbound-gateway session-factory="ftpSessionFactory"
							  command="ls"
							  expression="payload"/>
	</si:chain>


</beans>
