Class DirectoryWalker

    • Constructor Summary

      Constructors 
      Constructor Description
      DirectoryWalker​(java.io.File file)  
      DirectoryWalker​(java.io.File file, java.io.FilenameFilter filter)
      Constructs a walker.
      DirectoryWalker​(java.io.File file, java.util.regex.Pattern ignoreNameRegex)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isRestricted()  
      private void process​(RatReport report, java.io.File file)
      Process a directory, ignoring any files/directories set to be ignored.
      private void processDirectories​(RatReport report, java.io.File[] files)
      Process all directories in a set of file objects, ignoring any directories set to be ignored.
      private void processDirectory​(RatReport report, java.io.File file)
      Process a directory, restricted directories will be ignored.
      private void processNonDirectories​(RatReport report, java.io.File[] files)
      Process all files in a set of file objects, ignoring any files set to be ignored.
      private void report​(RatReport report, java.io.File file)
      Report on the given file.
      void run​(RatReport report)
      Run a report over all files and directories in this DirectoryWalker, ignoring any files/directories set to be ignored.
      • Methods inherited from class java.lang.Object

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

      • DirectoryWalker

        public DirectoryWalker​(java.io.File file)
      • DirectoryWalker

        public DirectoryWalker​(java.io.File file,
                               java.io.FilenameFilter filter)
        Constructs a walker.
        Parameters:
        file - not null
        filter - filters input files (optional), or null when no filtering should be performed
      • DirectoryWalker

        public DirectoryWalker​(java.io.File file,
                               java.util.regex.Pattern ignoreNameRegex)
    • Method Detail

      • isRestricted

        public boolean isRestricted()
      • processDirectory

        private void processDirectory​(RatReport report,
                                      java.io.File file)
                               throws RatException
        Process a directory, restricted directories will be ignored.
        Parameters:
        report - The report to process the directory with
        file - the directory to process
        Throws:
        RatException
      • run

        public void run​(RatReport report)
                 throws RatException
        Run a report over all files and directories in this DirectoryWalker, ignoring any files/directories set to be ignored.
        Specified by:
        run in interface IReportable
        Parameters:
        report - the defined RatReport to run on this Directory walker.
        Throws:
        RatException
      • process

        private void process​(RatReport report,
                             java.io.File file)
                      throws RatException
        Process a directory, ignoring any files/directories set to be ignored.
        Parameters:
        report - the report to use in processing
        file - the run the report against
        Throws:
        RatException
      • processDirectories

        private void processDirectories​(RatReport report,
                                        java.io.File[] files)
                                 throws RatException
        Process all directories in a set of file objects, ignoring any directories set to be ignored.
        Parameters:
        report - the report to use in processing
        files - the files to process (only directories will be processed)
        Throws:
        RatException
      • processNonDirectories

        private void processNonDirectories​(RatReport report,
                                           java.io.File[] files)
                                    throws RatException
        Process all files in a set of file objects, ignoring any files set to be ignored.
        Parameters:
        report - the report to use in processing
        files - the files to process (only files will be processed)
        Throws:
        RatException
      • report

        private void report​(RatReport report,
                            java.io.File file)
                     throws RatException
        Report on the given file.
        Parameters:
        report - the report to process the file with
        file - the file to be reported on
        Throws:
        RatException