user509755
user509755

Reputation: 2981

inbound sftp channel adapter file locking issue

I am using sftp inbound channel adapter with custom remote filter. If filter accept that file then it is processed later and deleted fine as i set property "true" for remote delete.

Now when my file is not processed successfully and throws exception then i catch that exception and want to move locally download file to someother place but when i do that using FileUtils.forceDelete then it is throwing exception

java.io.IOException: Unable to delete file:

Looks like some other thread has lock on this file. Is there any way we can find out who owns the lock and how to release it so that my listener can move it to diff location.

Upvotes: 1

Views: 252

Answers (1)

Gary Russell
Gary Russell

Reputation: 174544

not processed successfully and throws exception

Be sure to close the file in a finally block so your processing logic will always close the file.

Upvotes: 1

Related Questions