Class Source.PathSource

java.lang.Object
org.jline.builtins.Source.PathSource
All Implemented Interfaces:
Source
Enclosing interface:
Source

public static class Source.PathSource extends Object implements Source
A Source implementation that reads from a file system path.
  • Constructor Details

    • PathSource

      public PathSource(File file, String name)
    • PathSource

      public PathSource(Path path, String name)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Source
      Gets the name of this source.
      Specified by:
      getName in interface Source
      Returns:
      the name of the source
    • read

      public InputStream read() throws IOException
      Description copied from interface: Source
      Opens a stream to read the content of this source.
      Specified by:
      read in interface Source
      Returns:
      an input stream for reading the source content
      Throws:
      IOException - if an I/O error occurs
    • lines

      public Long lines()
      Description copied from interface: Source
      Gets the number of lines in this source, if known.
      Specified by:
      lines in interface Source
      Returns:
      the number of lines, or null if unknown