membersound
membersound

Reputation: 86747

How to automatically delete local files with FtpInboundFileSynchronizer?

I'm synchronizing an folder using FtpInboundFileSynchronizer.synchronizeToLocalDirectory().

Unfortunately only new files are downloaded, but files not present on the ftp are not removed locally. How can I configure the class to automatically remove any nonexisting files also locally?

Upvotes: 1

Views: 173

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

That's not currently supported by the synchronizer.

You could implement it with a couple of FtpOutboundGateways; first use a gateway to LS the remote directory and remove local files that don't exist remotely; then use a gateway to GET the missing files.

You could also do it programmatically with an FtpRemoteFileTemplate.

Upvotes: 1

Related Questions