Files.newDirectoryStream vs. Files.list
I am aware that Files.list(Path) uses Files.newDirectoryStream(Path) internally and basically just wraps the DirectoryStream. However I don't understand, when I want to use the first or the latter one. Is this just a convenience method, if I want to use the streaming API? I could have done this fairly easy myself, see this question . If one looks at the implementation of Files.list , exceptions thrown by the internal DirectoryStream are wrapped in UncheckedIOException . Anything I should know about this? This is in general a matter of style. If you want to use external iteration ( for(Path