How to detect files deleted in subdirectories?

So it's a little bit difficult to explain. I need to watch for any change in a specific location in my project, e.g. src/main/resources/templates. I implemented a VirtualFileAdapter and all changes (e.g. file deleted, file created, etc.) are properly detected. The problem is that if I delete a subdirectory, e.g. src/main/resources/templates/folder1 - it only sends the event for src/main/resources/templates/folder1, but I have no indication which files in that subdirectory were deleted. So I'm wondering if there's any way to get a list of all files that were in a deleted folder.

 

1 comment
Comment actions Permalink

In VirtualFileAdapter.beforeFileDeletion(), the virtual directory still exists and you may invoke getChildren() on it.

1

Please sign in to leave a comment.