Spring Integration FTP - poll without transfer? -


i'd utilize spring integration initiate messages about files appear in remote location, without transferring them. require generation of message with, say, header values indicating path file , filename.

what's best way accomplish this? i've tried stringing ftp inbound channel adapter service activator write header values need, causes file transferred local temp directory, , time service activator sees it, message consists of java.io.file refers local file , remote path info gone. possible transform message prior local transfer occurring?

we have similar problem , solved filters. on inbound-channel-adapter can set custom filter implementation. before polling filter called , have informations files, can decide file downloaded or not, example;

<int-sftp:inbound-channel-adapter id="test"                                   session-factory="sftpsessionfactory"                                   channel="testchannel"                                   remote-directory="${sftp.remote.dir}"                                   local-directory="${sftp.local.dir}"                                   filter="customfilter"                                   delete-remote-files="false">     <int:poller trigger="pollingtrigger" max-messages-per-poll="${sftp.max.msg}"/> </int-sftp:inbound-channel-adapter>  <beans:bean id="customfilter" class="your.class.location.sftpremotefilter"/> 

filter class implementation of filelistfilter interface. here dummy filter implementation.

public class sftpremotefilter implements filelistfilter<lsentry> {      private static final logger log = loggerfactory.getlogger(sftpremotefilter.class);      @override     public final list<lsentry> filterfiles(lsentry[] files) {        log.info("here files.");        //do smart        return collections.emptylist();     } } 

but if want described, think possible setting headers on payloads , using same headers when using payload, in case should use message<file> instead file in service activator method.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -