Given a partial directory tree:
dir x - | ..........| - dir y ..........| -file a
and given that a valid Path object, dir, points to x, and given this snippet:
WatchKey key = dir.register(watcher, ENTRY_CREATE);
If a WatchService is set using the given WatchKey, what would be the result if a file is added to dir y?
A is correct because watch service only looks at a single directory.
If you want to look at subdirectories, you need to set recursive watch keys.
This is usually done using a FileVisitor.