Returns a {@link Traverser} instance for the file and directory tree. The returned traverser starts from a {@link Path} and will return all files and directories it encounters. <p>The returned traverser attempts to avoid following symbolic links to directories. However, the traverser cannot guarant
()
| 292 | * @since 23.5 |
| 293 | */ |
| 294 | public static Traverser<Path> fileTraverser() { |
| 295 | return Traverser.forTree(MoreFiles::fileTreeChildren); |
| 296 | } |
| 297 | |
| 298 | private static Iterable<Path> fileTreeChildren(Path dir) { |
| 299 | if (Files.isDirectory(dir, NOFOLLOW_LINKS)) { |