Class GoSourceCodeFilter

  • All Implemented Interfaces:
    java.io.FileFilter, java.io.FilenameFilter, org.apache.commons.io.filefilter.IOFileFilter

    public class GoSourceCodeFilter
    extends AbstractFileFilter
    Filters go source code satisfying a specific predicate. By default, files/directories whose name starts with _ or . and testdata directory will be discarded no matter what the predicate is.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean acceptDir​(java.io.File dir)  
      protected boolean acceptFile​(java.io.File file)  
      static java.util.Collection<java.io.File> filterGoFiles​(java.io.File projectDir, GoSourceCodeFilter.SourceSetType sourceSetType)  
      static java.util.Collection<java.io.File> filterGoFiles​(java.io.File projectDir, java.lang.String configuration)  
      static java.util.Collection<java.io.File> filterTestsMatchingPattern​(java.io.File projectDir, java.util.List<java.lang.String> patterns)
      Filters tests files with specific patterns.
      • Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter

        accept, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • filterGoFiles

        public static java.util.Collection<java.io.File> filterGoFiles​(java.io.File projectDir,
                                                                       java.lang.String configuration)
      • filterTestsMatchingPattern

        public static java.util.Collection<java.io.File> filterTestsMatchingPattern​(java.io.File projectDir,
                                                                                    java.util.List<java.lang.String> patterns)
        Filters tests files with specific patterns. Wildcards are supported.
        Parameters:
        projectDir - the project root directory.
        patterns - the pattern list
        Returns:
        all files in the project directory (recursively) matching the patterns