You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simon Legner (JIRA)" <ji...@apache.org> on 2015/09/18 23:36:04 UTC

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

     [ https://issues.apache.org/jira/browse/VFS-569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Legner updated VFS-569:
-----------------------------
    Attachment: VFS-569.patch

{{org.apache.commons.vfs2.impl.DefaultFileMonitor#addFile}} did not check whether {[recursive}} was set and added listeners for children in any case. This has been corrected …

> 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.4#6332)