Class AbstractDirectoryWalker

  • All Implemented Interfaces:
    java.lang.Iterable<java.io.File>, DirectoryWalker
    Direct Known Subclasses:
    AsciiDocDirectoryWalker

    public abstract class AbstractDirectoryWalker
    extends java.lang.Object
    implements DirectoryWalker
    Base class which inspects parent directory and all subdirectories and returns all files which match certain condition.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean isAcceptedFile​(java.io.File filename)
      Method to implement which is called to decide if file should be filtered or not.
      java.util.List<java.io.File> scan()
      Method that finds all files that meets some criteria.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • AbstractDirectoryWalker

        public AbstractDirectoryWalker​(java.lang.String baseDir)
    • Method Detail

      • scan

        public java.util.List<java.io.File> scan()
        Method that finds all files that meets some criteria.
        Specified by:
        scan in interface DirectoryWalker
        Returns:
        List of files which meets the defined criteria.
      • isAcceptedFile

        protected abstract boolean isAcceptedFile​(java.io.File filename)
        Method to implement which is called to decide if file should be filtered or not.
        Parameters:
        filename - current file.
        Returns:
        true if file should be added to returned list, false otherwise.