private void register(List<String> watchedFiles) throws IOException
    {
        for(String watchedFile : watchedFiles)
        {
            String watchedDir = new File(watchedFile).getParentFile().getAbsolutePath();
            
            Path dir = Paths.get(watchedDir);
            // we are not watching for create and delete events for this directory
            WatchKey key = dir.register(watcher,  ENTRY_MODIFY);
            this.watchedFiles.add(watchedFile);
            keys.put(key, dir);            
        }
        System.out.println("watcher registration done for: "+watchedFiles);
    }