Class GlobIgnoreMatcher

java.lang.Object
org.apache.rat.mp.util.ignore.GlobIgnoreMatcher
All Implemented Interfaces:
IgnoreMatcher

public class GlobIgnoreMatcher extends Object implements IgnoreMatcher
  • Constructor Details

    • GlobIgnoreMatcher

      public GlobIgnoreMatcher()
    • GlobIgnoreMatcher

      public GlobIgnoreMatcher(org.apache.maven.plugin.logging.Log log, File scmIgnore)
  • Method Details

    • addRule

      public void addRule(String rule)
      Add a single rule to the set
      Parameters:
      rule - The line that matches some files
    • addRules

      public void addRules(Collection<String> rules)
      Add a set of rules to the set
      Parameters:
      rules - The line that matches some files
    • loadFile

      public void loadFile(org.apache.maven.plugin.logging.Log log, File scmIgnore)
      Parses excludes from the given SCM ignore file.
      Parameters:
      log - Maven log to show output during RAT runs.
      scmIgnore - if null or invalid an empty list of exclusions is returned.
    • isComment

      public static boolean isComment(String line)
      Determines whether the given line is a comment or not based on scanning for prefixes
      Parameters:
      line - line to verify.
      Returns:
      true if the given line is a commented out line.
      See Also:
      COMMENT_PREFIXES
    • getExclusionLines

      public List<String> getExclusionLines()
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: IgnoreMatcher
      Returns true if this IgnoreMatcher contains no rules.
      Specified by:
      isEmpty in interface IgnoreMatcher
      Returns:
      true if this IgnoreMatcher contains no rules
    • isIgnoredFile

      public Optional<Boolean> isIgnoredFile(String filename)
      Description copied from interface: IgnoreMatcher
      Checks if the file matches the stored expressions.
      Specified by:
      isIgnoredFile in interface IgnoreMatcher
      Parameters:
      filename - The filename to be checked
      Returns:
      empty: not matched, True: must be ignored, False: it must be UNignored