Reputation: 2981
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
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