FileVisitor
FileVisitor is an interface in Java's NIO.2 API, introduced in Java 7, that defines a visitor pattern for traversing a file tree. It allows for custom actions to be performed when encountering different types of file system entries, such as files, directories, and symbolic links. The interface consists of several methods: `preVisitDirectory`, `visitFile`, `visitFileFailed`, and `postVisitDirectory`. Each of these methods is called by the `Files.walkFileTree` method at appropriate stages of the traversal.
The `preVisitDirectory` method is invoked before visiting the contents of a directory. The `visitFile` method is
Implementations of FileVisitor can be used for a variety of tasks, including searching for specific files,