Class FileNameFilter
java.lang.Object
io.jenkins.plugins.analysis.core.filter.FileNameFilter
- All Implemented Interfaces:
Predicate<edu.hm.hafner.analysis.Issue>
- Direct Known Subclasses:
NullFileNameFilter
A
Predicate that filters Issue instances by checking their file names against
a provided collection of allowed paths.
This filter bridges the difference between the absolute paths that static analysis tools often report
and the workspace relative paths that SCM tools (like git diff) produce: an entry matches an
issue if it is either the complete file name of that issue, or a suffix of it that starts at a path
segment boundary. So src/File.ts matches an issue in /var/jenkins/job/src/File.ts,
while Test.java does not match an issue in src/MyTest.java.
Because the match does not depend on whether the file names of the issues have already been resolved to absolute paths, the filter yields the same result before and after post processing.
- Author:
- Michael Trimarchi
-
Constructor Summary
ConstructorsConstructorDescriptionFileNameFilter(Collection<String> files) Creates a new instance ofFileNameFilter. -
Method Summary
Modifier and TypeMethodDescriptionbooleantest(edu.hm.hafner.analysis.Issue issue) Evaluates this predicate on the given issue.
-
Constructor Details
-
FileNameFilter
Creates a new instance ofFileNameFilter.- Parameters:
files- the collection of file paths to include in the filter. These are typically retrieved from a version control system's diff output. Blank entries are ignored: an entry that matches every file would silently disable the filter.
-
-
Method Details