<?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:int="http://www.springframework.org/schema/integration"
	xmlns:int-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">

	<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
		<property name="host" value="localhost"/>
		<property name="knownHostsResource"
						value="#{ new org.springframework.core.io.ByteArrayResource('local, foo.com, bar.foo'.bytes)}"/>
		<property name="privateKey" value="classpath:org/springframework/integration/sftp/config/sftpTest"/>
		<property name="privateKeyPassphrase" value="ghj"/>
		<property name="password" value="hello"/>
		<property name="port" value="2222"/>
		<property name="user" value="oleg"/>
	</bean>

	<int:channel id="inputChannel"/>

	<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter"
				session-factory="sftpSessionFactory"
				channel="inputChannel"
				charset="UTF-8"
				remote-filename-generator="fileNameGenerator"
				remote-directory="foo/bar"
				remote-directory-expression="'foo'"/>


	<bean id="fileNameGenerator" class="org.mockito.Mockito" factory-method="mock">
		<constructor-arg value="org.springframework.integration.file.FileNameGenerator" type="java.lang.Class"/>
	</bean>

</beans>
