code: public static boolean isExcluded(String filename, List<String> excludes) {
          logger.debug("filename = [{}], excludes = [{}]", filename, excludes);
  
          // No rules ? Fine, we index everything
          if (excludes == null || excludes.isEmpty()) {
              logger.trace("no rules");
              return false;
          }
  
          // Exclude rules : we know that whatever includes rules are, we should exclude matching files
          for (String exclude : excludes) {
              String regex = exclude.toLowerCase().replace("?", ".?").replace("*", ".*?");
              logger.trace("regex is [{}]", regex);
              if (filename.toLowerCase().matches(regex)) {
                  logger.trace("does match exclude regex");
                  return true;
              }
          }
  
          logger.trace("does not match any exclude pattern");
          return false;
      }
docs: We check if we can index the file or if we should ignore it
  
  @param filename The filename to scan
  @param excludes exclude rules, may be empty not null