public boolean excludesPath()

in src/main/java/org/apache/maven/buildcache/checksum/exclude/Exclusion.java [124:145]


    public boolean excludesPath(Path parentPath, Path path) {
        if (applies(path)) {
            switch (matcherType) {
                case FILENAME:
                    if (matchesAllPaths || matchesAllNames || matcher.matches(path.getFileName())) {
                        return true;
                    }
                    break;
                case PATH:
                    // If path is configured relative, matching has to be done relatively to the project directory in
                    // order to be independent from
                    // the project location on the disk.
                    if (matchesAllPaths || matcher.matches(configuredAsAbsolute ? path : parentPath.relativize(path))) {
                        return true;
                    }
                    break;
                default:
                    throw new RuntimeException("Exclusion resolution type not handled.");
            }
        }
        return false;
    }