Package com.tnsai.rag

Class IngestionPathSelector

java.lang.Object
com.tnsai.rag.IngestionPathSelector

public final class IngestionPathSelector extends Object
Portable include/exclude globs for FILE knowledge-source candidates.

Patterns match the entire root-relative path, using / separators and no leading slash. * and ? do not cross directories; ** matches zero or more path segments. include is evaluated first; a match in exclude always wins. An empty include list admits every path; an empty exclude list admits every include match.

Since:
0.13.0
  • Method Details

    • compile

      public static Pattern compile(String glob)
      Compiles one glob or throws with the offending selector.
      Parameters:
      glob - selector text
      Returns:
      anchored regex
    • matches

      public static boolean matches(Path relativePath, List<String> include, List<String> exclude)
      Whether relativePath is admitted by the two selector lists.
    • matches

      public static boolean matches(String relativeKey, List<String> include, List<String> exclude)
      Whether a /-normalized relative path is admitted.
    • relativeKey

      public static String relativeKey(Path relativePath)
      Renders a relative path with / separators, independent of the host filesystem.