[ 
https://issues.apache.org/jira/browse/IO-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13865568#comment-13865568
 ] 

Joerg Pacher commented on IO-420:
---------------------------------

Issue is solved when changing FileAlterationOberserver.checkAndNotify to:

                if (rootFile.exists()) {
                        rootEntry.setExists(true);
                        checkAndNotify(rootEntry, rootEntry.getChildren(),
                                        listFiles(rootFile));
                } else if (rootEntry.isExists()) {
                        rootEntry.setExists(false);
                        checkAndNotify(rootEntry, rootEntry.getChildren(),
                                        FileUtils.EMPTY_FILE_ARRAY);
                } else {
                        // Didn't exist and still doesn't
                }


> Detection of deleted directories fails if the directory does not exist when 
> the observer is created.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: IO-420
>                 URL: https://issues.apache.org/jira/browse/IO-420
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.4
>            Reporter: Joerg Pacher
>
> If a directory is observed, that doesn't exist when the observer is created, 
> no deletion event will be created, when this directory is deleted again.
> Use case: mounting/unmounting of usb devices



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to