Class RecursiveDirectoryScanner

java.lang.Object
org.springframework.integration.file.DefaultDirectoryScanner
org.springframework.integration.file.RecursiveDirectoryScanner
All Implemented Interfaces:
DirectoryScanner

public class RecursiveDirectoryScanner extends DefaultDirectoryScanner
The DefaultDirectoryScanner extension which walks through the directory tree using Files.walk(Path, int, FileVisitOption...).

By default this class visits all levels of the file tree without any FileVisitOptions.

Since:
5.0
Author:
Artem Bilan, Gary Russell
See Also:
  • Constructor Details

    • RecursiveDirectoryScanner

      public RecursiveDirectoryScanner()
  • Method Details

    • setMaxDepth

      public void setMaxDepth(int maxDepth)
      The maximum number of directory levels to visit.
      Parameters:
      maxDepth - the maximum number of directory levels to visit
    • setFileVisitOptions

      public void setFileVisitOptions(FileVisitOption... fileVisitOptions)
      The options to configure the traversal.
      Parameters:
      fileVisitOptions - options to configure the traversal
    • listFiles

      public List<File> listFiles(File directory) throws IllegalArgumentException
      Description copied from interface: DirectoryScanner
      Scans the directory according to the strategy particular to this implementation and returns the selected files as a File array. This method may never return files that are rejected by the filter.
      Specified by:
      listFiles in interface DirectoryScanner
      Overrides:
      listFiles in class DefaultDirectoryScanner
      Parameters:
      directory - the directory to scan for files
      Returns:
      a list of files representing the content of the directory
      Throws:
      IllegalArgumentException - if the input is incorrect