I have the following files and folders structure:
/root/
/root/pictures/
/root/pictures/picture1.jpg
/root/pictures/picture2.jpg
I registered two WatchServices, one for the /root/
folder and one for /root/pictures
. For both I registered the events: ENTRY_CREATE
, ENTRY_DELETE
, ENTRY_MODIFY
.
When I delete /root/pictures/
I expect to get one ENTRY_DELETE
event for the deletion of the folder /root/pictures/
and two ENTRY_DELETE
events for picture1.jpg
and picture2.jpg
. In fact I only get the ENTRY_DELETE
event for /root/pictures/
. When I only delete picture1.jpg
I get one delete event as expected.
Is that normal behaviour? How can I get the list of files that were inside a deleted folder with WatchService?