code: public static void shutdown() throws IOException {
          if (watcher != null) {
              synchronized (watcher) {
                  log.info("Closing filesystem monitor.");
                  watcher.close();
                  watcher = null;
              }
          }
      }
docs: Closes the {@link WatchService}.
  
  @throws IOException If an error occurs on {@link WatchService#close()}.