java - Spring Integration get FTP files recursively with outbound-gateway -
i'm trying files within directory structure of 3 levels deep.
example:
- image a.jpg exists in folder /images/12/34/
- image b.jpg exists in folder /images/56/78
i've tried outbound-gateway stated in :
https://github.com/spring-projects/spring-integration-samples/blob/master/basic/ftp/src/test/resources/meta-inf/spring/integration/ftpoutboundgatewaysample-context.xml
and
http://forum.spring.io/forum/spring-projects/integration/104612-inbound-ftp-polling-sub-directories?p=604430#post604430
my configuration :
<bean id="ftpsessionfactory" class="org.springframework.integration.ftp.session.defaultftpsessionfactory"> <property name="host" value="127.0.0.1"/> <property name="port" value="21"/> <property name="username" value="administrator"/> <property name="password" value="sgtspeedy1"/> <property name="filetype" value="2"/> <property name="clientmode" value="2" /> </bean> <int-ftp:outbound-gateway id="gatewayls" cache-sessions="false" session-factory="ftpsessionfactory" request-channel="inbound" command="ls" command-options="" expression="'/images/*/*'" reply-channel="tosplitter"/> <int:channel id="tosplitter" /> <int-stream:stdout-channel-adapter channel="tosplitter" append-newline="true"/>
i've omitted splitter , print out testing purposes.
when testing, not file. i've tried setting folder /images/* , returns images under 'images' folder not recursively stated in links provided. folders /12/34 , /56/78 aren't taken account.
i cannot see i'm missing. can help?
p.s. i'm working on spring integration 2.2.6 without option upgrade 4.0.2 (newest), because i'm using framework. otherwise i'd use -r option gateway!
i tested foo/foo/bar/qux.txt
, foo/foo/baz/fiz.txt
with
<int-ftp:outbound-gateway id="gatewayls" session-factory="ftpsessionfactory" request-channel="inbound" command="ls" command-options="-1" expression="'foo/*/*'" reply-channel="tosplitter"/>
and worked fine; expected...
11:34:55.983 debug [main] ...[payload arraylist content=[fiz.txt, qux.txt]]...
(i added -1 option filename).
this using linux ftpd on server side.
are sure files in /images
, not images
? (or user chrooted /
home)?
Comments
Post a Comment