code: protected boolean matches(File f, boolean isFile) {
          if (fileFilter != null) {
              if (isFile && directoriesOnly) {
                  return false;
              } else if (!isFile && filesOnly) {
                  return false;
              } else if (fileNameRegex != null) {
                  Matcher m = fileNameRegex.matcher(f.getName());
                  if (!m.matches()) {
                      return false;
                  }
              }
          }
          return true;
      }
docs: Check to see if this is a resource we're monitoring based
  on the filter configuration
  
  @param f File (or directory) to match against configured file filters
  @param isFile true if this is a file (instead of a directory). This is looked
  up once and passed around.
  @return true if no filter is configured, or if the file matches the filter