1Z0-805 · Question #54
Which three enum constants are defined in FilevisitResult?
The correct answer is A. CONTINUE B. SKIP_SIBLINGS D. TERMINATE. The FileVisitor methods return a FileVisitResult value. You can abort the file walking process or control whether a directory is visited by the values you return in the FileVisitor methods: CONTINUE ?Indicates that the file walking should continue. If the preVisitDirectory…
Question
Which three enum constants are defined in FilevisitResult?
Options
- ACONTINUE
- BSKIP_SIBLINGS
- CFOLLOW_LINKS
- DTERMINATE
- ENOFOLLOW_LINKS
- FDELETE_CHILD
How the community answered
(13 responses)- A77% (10)
- E8% (1)
- F15% (2)
Explanation
The FileVisitor methods return a FileVisitResult value. You can abort the file walking process or control whether a directory is visited by the values you return in the FileVisitor methods: * CONTINUE ?Indicates that the file walking should continue. If the preVisitDirectory method returns CONTINUE, the directory is visited. * SKIP_SIBLINGS ?When preVisitDirectory returns this value, the specified directory is not visited, postVisitDirectory is not invoked, and no further unvisited siblings are visited. If returned from the postVisitDirectory method, no further siblings are visited. Essentially, nothing further happens in the specified directory. * TERMINATE ?Immediately aborts the file walking. No further file walking methods are invoked after this value is returned. * SKIP_SUBTREE ?When preVisitDirectory returns this value, the specified directory and its subdirectories are skipped. This branch is "pruned out" of the tree. Note:To walk a file tree, you first need to implement a FileVisitor. A FileVisitor specifies the required behavior at key points in the traversal process: when a file is visited, before a directory is accessed, after a directory is accessed, or when a failure occurs.
Topics
Community Discussion
No community discussion yet for this question.