class FileMatcher {

  public boolean matches(final Path path) {
    final Path canonicalPath= this.root.resolve(path).toAbsolutePath().normalize();

    // if the path matches an exclude pattern, we can return false
    for (final MatchPattern matchPattern : this.i18nExcludePatterns) {
      // FIXME: How to decide whether to be case sensitive or not? Can we ask the filesystem?
      //        No builtin way in Java. We would need to write a file to check: https://stackoverflow.com/a/58349517/572645
      if (matchPattern.matchPath(canonicalPath.toString(), true)) {
        return false;
      }
    }

    // if the path matches an include pattern, we can return true
    for (final MatchPattern matchPattern : this.i18nIncludePatterns) {
      if (matchPattern.matchPath(canonicalPath.toString(), true)) {
        return true;
      }
    }

    // if there was no match, it obviously didn't match
    return false;
  }

  public  FileMatcher(final Path root, final String[] i18nIncludes);
  public  FileMatcher(final Path root, final List<String> i18nIncludes);
  public  FileMatcher(final Path root, final String[] i18nIncludes, final String[] i18nExcludes);
  public  FileMatcher(final Path root, final List<String> i18nIncludes, final List<String> i18nExcludes);

}