How do you list all files in a directory and filter them by extension using Java NIO?
You can use `Files.newDirectoryStream()` and pass a filter to list files with a specific extension.
Perfect! `Files.newDirectoryStream()` allows you to filter files by extension.
Can you provide an example of how to filter files with a `.txt` extension using `Files.newDirectoryStream()`?