/** * Run. */ @Override public void run() { while (running) { for (final FileAlterationObserver observer : observers) { observer.checkAndNotify(); } if (!running) { break; } try { Thread.sleep(interval); } catch (final InterruptedException ignored) { } } } }
/** * Call {@link FileAlterationObserver#checkAndNotify()}. * * @throws Exception if an error occurs */ protected void checkAndNotify() throws Exception { observer.checkAndNotify(); } }
/** * Check whether the file and its children have been created, modified or deleted. */ public void checkAndNotify() { /* fire onStart() */ for (final FileAlterationListener listener : listeners) { listener.onStart(this); } /* fire directory/file events */ final File rootFile = rootEntry.getFile(); if (rootFile.exists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), listFiles(rootFile)); } else if (rootEntry.isExists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); } else { // Didn't exist and still doesn't } /* fire onStop() */ for (final FileAlterationListener listener : listeners) { listener.onStop(this); } }
checkAndNotify(entry, entry.getChildren(), listFiles(files[c])); current[c] = entry; c++; } else { checkAndNotify(entry, entry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); doDelete(entry);
public void run() { while (running) { for (FileAlterationObserver observer : observers) { observer.checkAndNotify(); ...
protected void pollForChanges() { if (fileObserver != null) { fileObserver.checkAndNotify(); } }
/** * Run. */ public void run() { while (running) { for (FileAlterationObserver observer : observers) { observer.checkAndNotify(); } if (!running) { break; } try { Thread.sleep(interval); } catch (final InterruptedException ignored) { } } } }
/** * Run. */ public void run() { while (running) { for (FileAlterationObserver observer : observers) { observer.checkAndNotify(); } if (!running) { break; } try { Thread.sleep(interval); } catch (final InterruptedException ignored) { } } } }
/** * Run. */ public void run() { while (running) { for (final FileAlterationObserver observer : observers) { observer.checkAndNotify(); } if (!running) { break; } try { Thread.sleep(interval); } catch (final InterruptedException ignored) { } } } }
/** * Run. */ @Override public void run() { while (running) { for (final FileAlterationObserver observer : observers) { observer.checkAndNotify(); } if (!running) { break; } try { Thread.sleep(interval); } catch (final InterruptedException ignored) { } } } }
@Override public Result check() { result = Result.newResult(); fileAlterationObserver.checkAndNotify(); return result; }
public void checkFiles() throws IOException { logger.trace("Checking files"); logger.trace("=============="); for(FileAlterationObserver observer : observerList) { observer.checkAndNotify(); } processModifications(); printWatchMap(); }
/** * Check whether the file and its children have been created, modified or deleted. */ public void checkAndNotify() { /* fire onStart() */ for (final FileAlterationListener listener : listeners) { listener.onStart(this); } /* fire directory/file events */ final File rootFile = rootEntry.getFile(); if (rootFile.exists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), listFiles(rootFile)); } else if (rootEntry.isExists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); } else { // Didn't exist and still doesn't } /* fire onStop() */ for (final FileAlterationListener listener : listeners) { listener.onStop(this); } }
/** * Check whether the file and its chlidren have been created, modified or deleted. */ public void checkAndNotify() { /* fire onStart() */ for (final FileAlterationListener listener : listeners) { listener.onStart(this); } /* fire directory/file events */ final File rootFile = rootEntry.getFile(); if (rootFile.exists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), listFiles(rootFile)); } else if (rootEntry.isExists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); } else { // Didn't exist and still doesn't } /* fire onStop() */ for (final FileAlterationListener listener : listeners) { listener.onStop(this); } }
/** * Check whether the file and its chlidren have been created, modified or deleted. */ public void checkAndNotify() { /* fire onStart() */ for (FileAlterationListener listener : listeners) { listener.onStart(this); } /* fire directory/file events */ File rootFile = rootEntry.getFile(); if (rootFile.exists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), listFiles(rootFile)); } else if (rootEntry.isExists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); } else { // Didn't exist and still doesn't } /* fire onStop() */ for (FileAlterationListener listener : listeners) { listener.onStop(this); } }
/** * Check whether the file and its chlidren have been created, modified or deleted. */ public void checkAndNotify() { /* fire onStart() */ for (FileAlterationListener listener : listeners) { listener.onStart(this); } /* fire directory/file events */ File rootFile = rootEntry.getFile(); if (rootFile.exists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), listFiles(rootFile)); } else if (rootEntry.isExists()) { checkAndNotify(rootEntry, rootEntry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); } else { // Didn't exist and still doesn't } /* fire onStop() */ for (FileAlterationListener listener : listeners) { listener.onStop(this); } }
checkAndNotify(entry, entry.getChildren(), listFiles(files[c])); current[c] = entry; c++; } else { checkAndNotify(entry, entry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); doDelete(entry);
checkAndNotify(entry, entry.getChildren(), listFiles(files[c])); current[c] = entry; c++; } else { checkAndNotify(entry, entry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); doDelete(entry);
checkAndNotify(entry, entry.getChildren(), listFiles(files[c])); current[c] = entry; c++; } else { checkAndNotify(entry, entry.getChildren(), FileUtils.EMPTY_FILE_ARRAY); doDelete(entry);
synchronized protected void takeFullSnapshot(DirectorySnapshot snapshot) { // update the snapshot with every file in the directory spec FileAlterationObserver observer = new FileAlterationObserver(fileTriggerRouter .getFileTrigger().getBaseDir(), fileTriggerRouter.getFileTrigger() .createIOFileFilter()); observer.addListener(new SnapshotUpdater(snapshot)); observer.checkAndNotify(); }