docs: 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;
      }