meaning of PRUNE in FileVisitor.visitFile() ?
Rajendra Gutupalli
Rajendra.Gutupalli at Sun.COM
Fri Aug 8 09:26:29 PDT 2008
Alan Bateman wrote:
> Rajendra Gutupalli wrote:
>> Hi Alan,
>>
>> The spec for PRUNE says "Continue without visiting the entries in
>> this directory. This result is only meaningful when returned from the
>> preVisitDirectory method; otherwise this result type is the same as
>> returning CONTINUE.". Does the PRUNE work in visitFile() method as
>> "Continue without visiting 'remaining' entries in the directory". Now
>> it treats PRUNE as CONTINUE in visitFile() method. Could you please
>> tell me how can we continue from visiting the remaining entries of
>> the directory?
> Do you have any examples of where this would be used? It would be
> straight-forward (actually trivial) to add a SKIP_SIBLINGS option if
> needed.
Alan, I was just thinking about the flexibility of usage. During
traversing of a directory structure one might want to skip the entries
in directory (after visiting some entries) and move on to other
directory . For example if I am looking for a specific kind of a file in
a each directory and if I found that file then I might not need to visit
the remaining files.
Thanks
Rajendra.
More information about the nio-dev
mailing list