commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Legner (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (VFS-569) DefaultFileMonitor recursive file
Date Fri, 18 Sep 2015 21:36:04 GMT

     [ 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)

Mime
View raw message