Class TraverseLevels<K>

java.lang.Object
com.norconex.crawler.fs.fetch.acl.TraverseLevels<K>
Type Parameters:
K - the key a folder is known by (its path)

public final class TraverseLevels<K> extends Object

The path levels of a file on a source where reading a file also needs the right to go through every folder above it (POSIX-style sources, and Linux servers shared through Samba): one level per folder above that does not let everybody through, in order from the top, without repeating a level already there. Most files get none, or one.

Each folder's level is worked out once per crawl and kept, keyed by the folder's path. A folder whose permissions could not be read is not kept, so it is tried again for the next file.

  • Field Details

  • Constructor Details

    • TraverseLevels

      public TraverseLevels()
  • Method Details

    • levels

      public List<AclLevel> levels(List<K> folders, TraverseLevels.FolderReader<K> reader) throws IOException
      The levels for the folders above a file.
      Parameters:
      folders - the folders above the file, in any order (the top one first gives the most natural order)
      reader - how to read one folder
      Returns:
      the levels, possibly none
      Throws:
      IOException - if a folder's permissions could not be read
    • clear

      public void clear()
      Forgets the folders read so far.