Class ScmIgnoreParser


  • public final class ScmIgnoreParser
    extends java.lang.Object
    Helper to parse SCM ignore files to add entries as excludes during RAT runs. Since we log errors it needs to reside inside of the maven plugin.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.List<java.lang.String> COMMENT_PREFIXES  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ScmIgnoreParser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getExcludesFromFile​(org.apache.maven.plugin.logging.Log log, java.io.File scmIgnore)
      Parses excludes from the given SCM ignore file.
      static java.util.List<java.lang.String> getExclusionsFromSCM​(org.apache.maven.plugin.logging.Log log, java.io.File baseDir)
      Parse ignore files from all known SCMs that have ignore files.
      (package private) static boolean isComment​(java.lang.String line)
      Determines whether the given line is a comment or not based on scanning for prefixes {@see COMMENT_PREFIXES}.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMMENT_PREFIXES

        private static java.util.List<java.lang.String> COMMENT_PREFIXES
    • Constructor Detail

      • ScmIgnoreParser

        private ScmIgnoreParser()
    • Method Detail

      • getExcludesFromFile

        public static java.util.List<java.lang.String> getExcludesFromFile​(org.apache.maven.plugin.logging.Log log,
                                                                           java.io.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.
        Returns:
        all exclusions (=non-comment lines) from the SCM ignore file.
      • getExclusionsFromSCM

        public static java.util.List<java.lang.String> getExclusionsFromSCM​(org.apache.maven.plugin.logging.Log log,
                                                                            java.io.File baseDir)
        Parse ignore files from all known SCMs that have ignore files.
        Parameters:
        log - Show information via maven logger.
        baseDir - base directory from which to look for SCM ignores.
        Returns:
        Exclusions from the SCM ignore files.
      • isComment

        static boolean isComment​(java.lang.String line)
        Determines whether the given line is a comment or not based on scanning for prefixes {@see COMMENT_PREFIXES}.
        Parameters:
        line - line to verify.
        Returns:
        true if the given line is a commented out line.