/** * Fire directory/file change events to the registered listeners. * * @param entry The previous file system entry * @param path The current file */ private void doMatch(final FileStatusEntry entry, final Path path) throws IOException { if (entry.refresh(path)) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryChange(path); } else { listener.onFileChange(path); } } } }
/** * Fire directory/file delete events to the registered listeners. * * @param entry The file entry */ private void doDelete(final FileStatusEntry entry) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryDelete(entry.getPath()); } else { listener.onFileDelete(entry.getPath()); } } }
/** * Fire directory/file created events to the registered listeners. * * @param entry The file entry */ private void doCreate(final FileStatusEntry entry) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryCreate(entry.getPath()); } else { listener.onFileCreate(entry.getPath()); } } final FileStatusEntry[] children = entry.getChildren(); for (final FileStatusEntry aChildren : children) { doCreate(aChildren); } }
/** * Fire directory/file change events to the registered listeners. * * @param entry The previous file system entry * @param path The current file */ private void doMatch(final FileStatusEntry entry, final Path path) throws IOException { if (entry.refresh(path)) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryChange(path); } else { listener.onFileChange(path); } } } }
/** * Fire directory/file delete events to the registered listeners. * * @param entry The file entry */ private void doDelete(final FileStatusEntry entry) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryDelete(entry.getPath()); } else { listener.onFileDelete(entry.getPath()); } } }
/** * Fire directory/file created events to the registered listeners. * * @param entry The file entry */ private void doCreate(final FileStatusEntry entry) { for (final PathAlterationListener listener : listeners.values()) { if (entry.isDirectory()) { listener.onDirectoryCreate(entry.getPath()); } else { listener.onFileCreate(entry.getPath()); } } final FileStatusEntry[] children = entry.getChildren(); for (final FileStatusEntry aChildren : children) { doCreate(aChildren); } }