Пример #1
0
  public void deleteFileObserved(DirectoryWatcher watcher, UpdatingFileTree inAbsolutePath) {
    logger.finest("delete observed: " + inAbsolutePath.thisFile.getAbsolutePath());

    try {
      removalsToProcess.put(
          new FileChange(inAbsolutePath, watcher.getWatchType(), new File(watcher.getPath())));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
Пример #2
0
  public void newFileObserved(DirectoryWatcher watcher, UpdatingFileTree inAbsolutePath) {
    logger.finest("change event: " + inAbsolutePath.thisFile.getAbsolutePath());
    /** TODO: optimization: use prefix tree */
    synchronized (mExclusions) {
      for (String pre : mExclusions) {
        if (inAbsolutePath.thisFile.getAbsolutePath().startsWith(pre)) {
          // System.out.println("excluded by " + pre);
          return;
        }
      }
    }

    try {
      additionsToProcess.put(
          new FileChange(inAbsolutePath, watcher.getWatchType(), new File(watcher.getPath())));
      logger.finer("put into to check out q: " + inAbsolutePath.thisFile.getAbsolutePath());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }