Hey Oleg,
Thanks for your reply.
I want local directory to be dynamic.
I want to use the same gateway configuration for different types of entities else i would need to create n number of gateways for n number of entities.
While doing LS, for different type of entities, there is different remote location.
Say my entities are SPORTS, POLITICS.
I want different local directories for this entities. I need to code just once.
My ftp config is:
Code:
<int:channel id="ftpLsChannel" />
<int:channel id="ftpGetChannel" />
<int:gateway id="ftpLsGateway"
default-request-channel="ftpLsChannel"
service-interface="com.server.ftp.LSFTPGateway" />
<int:gateway id="ftpGetGateway"
default-request-channel="ftpGetChannel"
service-interface="com.server.ftp.GETFTPGateway" />
<int-ftp:outbound-gateway command="ls"
expression="payload" session-factory="ftpClientFactory"
request-channel="ftpLsChannel" />
<int-ftp:outbound-gateway command="get" id="getOutbound"
expression="payload" session-factory="ftpClientFactory"
local-directory="/home/anwaar/Desktop/csvs"
filename-pattern="*.csv" request-channel="ftpGetChannel" />
<bean id="ftpClientFactory"
class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<property name="host" value="test" />
<property name="port" value="21" />
<property name="username" value="test" />
<property name="password" value="testing" />
</bean>
I have an abstract class in which I call these ftp outbound gateways which has a variable for LOCAL_FILE_LOCATION.
Please help. Else I would be copying all the files in one local file directory only.
Regards,
Annuk