Class Source.PathSource

  • All Implemented Interfaces:
    Source
    Enclosing interface:
    Source

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

      • PathSource

        public PathSource​(java.io.File file,
                          java.lang.String name)
      • PathSource

        public PathSource​(java.nio.file.Path path,
                          java.lang.String name)
    • Method Detail

      • getName

        public java.lang.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 java.io.InputStream read()
                                 throws java.io.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:
        java.io.IOException - if an I/O error occurs
      • lines

        public java.lang.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