Class InputRC


  • public final class InputRC
    extends java.lang.Object
    Utility class for configuring a LineReader from an inputrc file.

    This class provides methods to configure a LineReader using initialization files in the same format as GNU Readline's inputrc files. These files can define key bindings, variable settings, and other configuration options.

    • Constructor Summary

      Constructors 
      Constructor Description
      InputRC()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void configure​(org.jline.reader.LineReader lineReader)
      Configures a LineReader using the default inputrc files.
      static void configure​(org.jline.reader.LineReader reader, java.io.InputStream is)
      Configures a LineReader from an inputrc file provided as an InputStream.
      static void configure​(org.jline.reader.LineReader reader, java.io.Reader r)
      Configures a LineReader from an inputrc file provided as a Reader.
      static void configure​(org.jline.reader.LineReader reader, java.net.URL url)
      Configures a LineReader from an inputrc file at the specified URL.
      static void configure​(org.jline.reader.LineReader lineReader, java.nio.file.Path path)
      Configures a LineReader from an inputrc file located at the specified file path, if that's an existing readable file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InputRC

        public InputRC()
    • Method Detail

      • configure

        public static void configure​(org.jline.reader.LineReader reader,
                                     java.net.URL url)
                              throws java.io.IOException
        Configures a LineReader from an inputrc file at the specified URL.
        Parameters:
        reader - the LineReader to configure
        url - the URL of the inputrc file
        Throws:
        java.io.IOException - if an I/O error occurs
      • configure

        public static void configure​(org.jline.reader.LineReader reader,
                                     java.io.InputStream is)
                              throws java.io.IOException
        Configures a LineReader from an inputrc file provided as an InputStream.
        Parameters:
        reader - the LineReader to configure
        is - the InputStream containing the inputrc content
        Throws:
        java.io.IOException - if an I/O error occurs
      • configure

        public static void configure​(org.jline.reader.LineReader reader,
                                     java.io.Reader r)
                              throws java.io.IOException
        Configures a LineReader from an inputrc file provided as a Reader.
        Parameters:
        reader - the LineReader to configure
        r - the Reader containing the inputrc content
        Throws:
        java.io.IOException - if an I/O error occurs
      • configure

        public static void configure​(org.jline.reader.LineReader lineReader,
                                     java.nio.file.Path path)
                              throws java.io.IOException
        Configures a LineReader from an inputrc file located at the specified file path, if that's an existing readable file.
        Parameters:
        lineReader - the LineReader to configure
        path - the Path representing the inputrc file
        Throws:
        java.io.IOException - if an I/O error occurs
      • configure

        public static void configure​(org.jline.reader.LineReader lineReader)
                              throws java.io.IOException
        Configures a LineReader using the default inputrc files.

        This method attempts to read the inputrc file from the user's home directory (e.g., ~/.inputrc) and from the system-wide configuration file (e.g., /etc/inputrc).

        Parameters:
        lineReader - the LineReader to configure
        Throws:
        java.io.IOException - if an I/O error occurs