Class DirectoryScan

java.lang.Object
net.bluemind.node.shared.DirectoryScan

public class DirectoryScan extends Object
  • Method Details

    • page

      public static DirectoryPage page(Path directory, Predicate<String> nameFilter, int pageSize, String after) throws IOException
      Read one page of regular files from a directory, ordered by file name. Only the pageSize smallest names above after are held in memory, so a directory with millions of entries is neither materialized nor sorted as a whole.
      Parameters:
      directory - scanned directory, not recursed into
      nameFilter - keeps the file names to return
      pageSize - maximum number of entries in the page
      after - name of the last entry of the previous page, null to start at the beginning of the directory
      Returns:
      an empty page when the directory does not exist
      Throws:
      IOException