Watch Service Flashcards
Gets an instance of the Watch Service
FileSystems.GetDefault()
Registers a path to the watch service instance.
register()
Watch service event that is raised when a file is modified.
ENTRY_MODIFY
Watch service event that is raised when a file is created.
ENTRY_CREATE
Watch service event that is raised when a file is deleted.
ENTRY_DELETE
Watch service event that is raised when too many events come in and some are missed.
OVERFLOW
Method that returns a queued key immediately, or null if none is available.
poll()
Overloaded version that returns a queued key, but waits for a specified timeout if none is available.
poll(long TimeUnit)
Method that blocks if no key is available.
take()
Method that gets the type of event from the key.
kind()
Method that gets the name of the file for which the event has occured.
context()
Method that resets the key.
reset()