Files.newDirectoryStream vs File.listFiles

Paulo Levi i30817 at gmail.com
Sat May 19 08:05:38 PDT 2012


The new io api seems a little verbose to me (especially the static methods
in Files - that i assume are going to be extension methods?)

I was just changing my code to use Paths instead of Files and i came upon
this case where the the listfiles alternative seems to mandate laziness and
one-off iteration. I get that it's good policy, however to retrofit code
that uses eager [] iteration it won't be a smooth transition.

Might you add a method that "drains" a hidden watch service into a list of
paths?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20120519/42cb54c5/attachment.html 


More information about the nio-discuss mailing list