// notify listeners about new event
private void callListeners(final WatchEvent event, final Path path) {
for (Map.Entry<Path, List<WatchEventListener>> list : listeners.entrySet()) {
for (WatchEventListener listener : list.getValue()) {
if (path.startsWith(list.getKey())) {
WatchFileEvent agentEvent = new HotswapWatchFileEvent(event, path);
try {
listener.onEvent(agentEvent);
} catch (Throwable e) {
LOGGER.error("Error in watch event '{}' listener '{}'", e, agentEvent, listener);