Class GitIgnoreBuilder
java.lang.Object
org.apache.rat.config.exclusion.fileProcessors.AbstractFileProcessorBuilder
org.apache.rat.config.exclusion.fileProcessors.GitIgnoreBuilder
Processes the
.gitignore
file.- See Also:
-
Field Summary
Fields inherited from class org.apache.rat.config.exclusion.fileProcessors.AbstractFileProcessorBuilder
commentFilter, fileName, REGEX_FMT
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a file processor that processes a.gitignore
file and ignores any lines starting with "#". -
Method Summary
Modifier and TypeMethodDescriptionmodifyEntry
(Consumer<MatcherSet> matcherSetConsumer, DocumentName documentName, String entry) Convert the string entry.Methods inherited from class org.apache.rat.config.exclusion.fileProcessors.AbstractFileProcessorBuilder
build, listFiles, process
-
Constructor Details
-
GitIgnoreBuilder
public GitIgnoreBuilder()Constructs a file processor that processes a.gitignore
file and ignores any lines starting with "#".
-
-
Method Details
-
modifyEntry
protected Optional<String> modifyEntry(Consumer<MatcherSet> matcherSetConsumer, DocumentName documentName, String entry) Convert the string entry. If the string ends with a slash anDocumentNameMatcher.and(java.util.Collection<org.apache.rat.document.DocumentNameMatcher>)
is constructed from a directory check and the file name matcher. In this case an empty Optional is returned. If the string starts with "!" then the entry is placed in the include list, otherwise the entry is placed in the exclude list and the name of the check returned.- Overrides:
modifyEntry
in classAbstractFileProcessorBuilder
- Parameters:
documentName
- The name of the document being processed.entry
- The entry from the document- Returns:
- and Optional containing the name of the matcher.
-