class FileWatcher extends ThreadServer implements Runnable {

  protected void rake(final Set<File> checked, final Set<File> changed) {
    logger.trace("Base: {}", base);
    logger.trace("Base's last modified: {}", lastModified);

    long max = 0;
    final Queue<File> files = new LinkedList<>(asList(base));
    while (!files.isEmpty()) {
      final File file = files.remove();
      logger.trace("File: {}", file);
      final long lastModifiedInFile = file.lastModified();
      max = Math.max(lastModifiedInFile, max);

      if (lastModified < lastModifiedInFile) {
        changed.add(file);
      }
      checked.add(file);
      final File[] children = nvl(file.listFiles(), new File[0]);

      logger.trace("Find {} files", children.length);
      files.addAll(stream(children)
          .filter(child -> !ignores.contains(child.getName())).collect(toList()));
    }

    lastModified = max;
  }

  public  FileWatcher(final File basePath);

}