private void register ( Path directory , boolean useFileTreeModifier ) throws IOException { logger . debug ( "Registering [{}]." , directory ) ; Watchable watchable = isMac ? new WatchablePath ( directory ) : directory ; WatchEvent . Modifier [ ] modifiers = useFileTreeModifier ? new WatchEvent . Modifier [ ] { ExtendedWatchEventModifier . FILE_TREE } : new WatchEvent . Modifier [ ] { } ; WatchEvent . Kind < ? > [ ] kinds = new WatchEvent . Kind < ? > [ ] { ENTRY_CREATE , ENTRY_DELETE , ENTRY_MODIFY } ; WatchKey watchKey = watchable . register ( watchService , kinds , modifiers ) ; keyRoots . put ( watchKey , directory ) ; }
Internal method to be used by registerAll