<?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:sftp="http://www.springframework.org/schema/integration/sftp"
	   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/sftp
			https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">


	<si:chain input-channel="outboundChannelAdapterInsideChain">
		<sftp:outbound-channel-adapter
				auto-create-directory="true"
				session-factory="sftpSessionFactory"
				remote-directory="remote-target-dir"/>
	</si:chain>

	<si:chain input-channel="outboundGatewayInsideChain" output-channel="replyChannel">
		<sftp:outbound-gateway local-directory="/tmp"
							   session-factory="sftpSessionFactory"
							   command="ls"
							   expression="payload"/>
	</si:chain>

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

	<bean id="sftpSessionFactory"
		  class="org.springframework.integration.sftp.outbound.SftpOutboundTests$TestSftpSessionFactory"/>

</beans>
