Class AllFilesWalker

java.lang.Object
io.github.sergeloie.languagecheck.scan.AllFilesWalker

public final class AllFilesWalker extends Object
Walks a directory tree collecting relative file paths, pruning excluded directories and skipping excluded files via an ExclusionMatcher.

Symbolic links are not followed: a link is never added to the result and a symlinked directory is not descended into, so the walk cannot escape the scan root.

  • Constructor Details

    • AllFilesWalker

      public AllFilesWalker()
  • Method Details

    • listFiles

      public List<String> listFiles(File root, ExclusionMatcher matcher)
      List all included files under root.
      Parameters:
      root - the directory to walk (typically the project root)
      matcher - exclusion rules; may be ExclusionMatcher.none()
      Returns:
      relative paths with '/' separators, in file-tree traversal order
      Throws:
      IllegalArgumentException - if root is not an existing directory or matcher is null