class WatcherNIO2 extends AbstractNIO2Watcher {
    private final static WatchEvent.Modifier HIGH;

    static {
        HIGH =  getWatchEventModifier("com.sun.nio.file.SensitivityWatchEventModifier","HIGH");
    }

    public WatcherNIO2() throws IOException {
        super();
    }

    @Override
    protected void registerAll(final Path dir) throws IOException {
        // register directory and sub-directories
        LOGGER.debug("Registering directory  {}", dir);

        Files.walkFileTree(dir, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
                register(dir);
                return FileVisitResult.CONTINUE;
            }
        });
    }

    /**
     * Register the given directory with the WatchService
     */
    private void register(Path dir) throws IOException {<FILL_FUNCTION_BODY>}
}

        // try to set high sensitivity
        final WatchKey key = HIGH == null ? dir.register(watcher, KINDS) : dir.register(watcher, KINDS, HIGH);
        keys.put(key, dir);
    
<methods>public void <init>() throws java.io.IOException,public void addDirectory(java.nio.file.Path) throws java.io.IOException,public synchronized void addEventListener(java.lang.ClassLoader, java.net.URI, org.hotswap.agent.watch.WatchEventListener) ,public void addEventListener(java.lang.ClassLoader, java.net.URL, org.hotswap.agent.watch.WatchEventListener) ,public void closeClassLoader(java.lang.ClassLoader) ,public void run() ,public void stop() <variables>protected static final Kind<?>[] KINDS,protected org.hotswap.agent.logging.AgentLogger LOGGER,protected Map<org.hotswap.agent.watch.WatchEventListener,java.lang.ClassLoader> classLoaderListeners,protected final non-sealed org.hotswap.agent.watch.nio.EventDispatcher dispatcher,protected final non-sealed Map<java.nio.file.WatchKey,java.nio.file.Path> keys,private final Map<java.nio.file.Path,List<org.hotswap.agent.watch.WatchEventListener>> listeners,private java.lang.Thread runner,private volatile boolean stopped,protected java.nio.file.WatchService watcher