NoSuchFileException thrown by FileTreeWalker

Alan Bateman Alan.Bateman at oracle.com
Tue Sep 8 11:11:52 UTC 2015


On 08/09/2015 09:43, Andrew Scully wrote:
> :
>
> The visitor in use is a java.nio.file.SimpleFileVisitor that overrides
> the #visitFile() and #preVisitDirectory() methods only.
>
> Any thoughts on how best to proceed (including a more appropriate
> mailing list if this isn't the right one!) would be greatly
> appreciated.
>
There was a lot of discussion a few years ago on the various 
"strategies" for dealing with errors when doing recursive operations. 
Files.walkFileTree was intended to let the user of the API decide how 
they want to handle errors, be it ignore, log, collect, fail, fail after 
some threshold, etc. So it does depend on whether you want to handle the 
errors. If you do, then it means overriding the visitFile method.

-Alan


More information about the nio-dev mailing list