Class Completers.DirectoriesCompleter

  • All Implemented Interfaces:
    org.jline.reader.Completer
    Enclosing class:
    Completers

    public static class Completers.DirectoriesCompleter
    extends Completers.FileNameCompleter
    A completer for directory names.

    This completer provides completion for directory paths, filtering out non-directory entries. It extends FileNameCompleter and overrides the accept method to only accept directories.

    • Constructor Summary

      Constructors 
      Constructor Description
      DirectoriesCompleter​(java.io.File currentDir)
      Creates a new DirectoriesCompleter with the specified current directory.
      DirectoriesCompleter​(java.nio.file.Path currentDir)
      Creates a new DirectoriesCompleter with the specified current directory.
      DirectoriesCompleter​(java.util.function.Supplier<java.nio.file.Path> currentDir)
      Creates a new DirectoriesCompleter with a supplier for the current directory.
    • Constructor Detail

      • DirectoriesCompleter

        public DirectoriesCompleter​(java.io.File currentDir)
        Creates a new DirectoriesCompleter with the specified current directory.
        Parameters:
        currentDir - the current directory as a File
      • DirectoriesCompleter

        public DirectoriesCompleter​(java.nio.file.Path currentDir)
        Creates a new DirectoriesCompleter with the specified current directory.
        Parameters:
        currentDir - the current directory as a Path
      • DirectoriesCompleter

        public DirectoriesCompleter​(java.util.function.Supplier<java.nio.file.Path> currentDir)
        Creates a new DirectoriesCompleter with a supplier for the current directory.
        Parameters:
        currentDir - a supplier that provides the current directory path
    • Method Detail

      • accept

        protected boolean accept​(java.nio.file.Path path)
        Determines if a path should be accepted for completion.

        Only accepts directories that also pass the parent class's accept method.

        Overrides:
        accept in class Completers.FileNameCompleter
        Parameters:
        path - the path to check
        Returns:
        true if the path should be accepted, false otherwise