Which two statements are true about the walkFileTreemethod of the Filesclass? (Choose two.)
Correct Answer: A,E
Explanation/Reference:
Explanation:
By default, symbolic links are not automatically followed by this method.
For each file encountered this method attempts to read its BasicFileAttributes. If the file is not a directory then the visitFile method is invoked with the file attributes. If the file attributes cannot be read, due to an I/O exception, then the visitFileFailed method is invoked with the I/O exception.
Incorrect Answers:
B: maxDepth is the maximum number of directory levels to visit.
C: Where the file is a directory, and the directory could not be opened, then the visitFileFailed method is invoked with the I/O exception, after which, the file tree walk continues, by default, at the next sibling of the directory.
D: The file tree traversal is depth-first.
Reference: https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html