Problem with FTP inbound-channel-adapter
I have a scenario in which the ftp inbound-channel-adapter does not quite fit.
Basically what I'm trying to do is monitoring the folder on the ftp server, and whenever there is a new zip/gzip file posted, ftp adapter downloads it to a local folder and put it into a input-channel. Then the ftp adapter deletes the remote file.
However, the problem here is that the zip/gzip files are usually quite large, say 10M ~ 100M, and I had to scan the ftp remote folder frequently in order to fetch the updates in time. Occasionally it happens that the server-side hasn't finished writing outputs to the ftp file, but my client side ftp adapter already becomes aware of the existence of this file and begins to download it. This results in a partial zip/gzip file and oftentimes leads to IOException in local processing.
Is there any convenient fix to this problem? Is it possible that I can write my own filter for ftp inbound-channel-adapter, just like for file adapter?