You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Beirtí Ó'Nunáin (JIRA)" <ji...@apache.org> on 2017/04/27 15:24:04 UTC

[jira] [Commented] (VFS-569) DefaultFileMonitor recursive file

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

Beirtí Ó'Nunáin commented on VFS-569:
-------------------------------------

[~tn] As stated in the description, it seems that the intention of the code is to add listeners to files already present in the folder for any modification. Instead of filtering out child folders, it also adds listeners to child folders, but only 1 element deep.

> DefaultFileMonitor recursive file
> ---------------------------------
>
>                 Key: VFS-569
>                 URL: https://issues.apache.org/jira/browse/VFS-569
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Java 7, windows 8, eclipse lune
>            Reporter: Sante
>         Attachments: VFS-569.patch
>
>
> FileSystemManager fsManager = VFS.getManager();
> 			FileObject fileObj = fsManager.resolveFile("file:///MyFolder");
> DefaultFileMonitor fm = new DefaultFileMonitor(listener);
> fm.setDelay(1);
> fm.setRecursive(false);
> fm.addFile(fileObj);
> fm.start();
> when execute fm.addFile(fileObj); library add listener an internal forder although not recursive.
> in this point:
> if (file.getType().hasChildren()){
>                 // Traverse the children
>                 final FileObject[] children = file.getChildren();
>                 for (final FileObject element : children) {
>                     doAddFile(element);
>                 }
>             }
> variable children: should be a file and not a folder!!!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)