Valid 1Z0-804 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-804 Exam! ExamDiscuss.com now offer the newest 1Z0-804 exam dumps, the ExamDiscuss.com 1Z0-804 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-804 dumps with Test Engine here:
An application is waiting for notification of changes to a tmp directory using the following code statements: Path dir = Paths.get("tmp") WatchKey key = dir.register (watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY) ; In the tmp directory, the user renames the file testA to testB, Which statement is true?
Correct Answer: A
Explanation/Reference: Explanation: Most file system implementations have native support for file change notification. The WatchService API takes advantage of this support where available. However, when a file system does not support this mechanism, the WatchService will poll the file system, waiting for events. Note: WatchKey : When a Watchable entity is registered with a WatchService a key which is a WatchKey is generated. Initially the key is in ready state waiting to be notified of any events on the Watchable entity. Once an event occurs the key goes into signaled state and allows to access the events using its pollEvents method. After processing the poll events the key has to be reset by invoking its reset method. Reference: The Java Tutorials,Watching a Directory for Changes