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

Gary D. Gregory commented on IO-439:
------------------------------------

The behavior seems clear to me based on:

{code:java}
    /**
     * Returns the directory being observed.
     *
     * @return the directory being observed.
     */
    public File getDirectory() {
        return rootEntry.getFile();
    }
{code}
So this is Javadoc issue only.

We cannot check and require for the directory-ness of the input anymore than we 
can require its existence.

This is an _observer_, it reacts to the changing state if the underlying file 
system. Consider this use case:
- The observer is created on A
- A file A is created
- The file A is deleted
- A directory A is created
- A file B is created in A.

If you think you can make the Javadoc better, feel free to provide a PR.


> FileAlterationObserver should check whether inputFile is a directory
> --------------------------------------------------------------------
>
>                 Key: IO-439
>                 URL: https://issues.apache.org/jira/browse/IO-439
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.4
>         Environment: Unix, Ubuntu 64
>            Reporter: Beniamin Kalinowski
>            Priority: Trivial
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> A FileAlterationObserver class receives a String/File object indicating 
> directory and checks whether this file has changed. It doesn't work if file 
> isn't a directory but no warnings/errors are being thrown.
> I think there should be a check if a given input is a directory.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to