void () { synchronized (myLock) { cancelCurrentTask(); } if (myWatcher != null) { try { myWatcher.close(); } catch (IOException e) { LOG.warn(e); } } myOpenFileSystems.forEach((p, fs) -> { try { fs.close(); } catch (IOException e) { LOG.warn(e); } }); }