Class PathTextReadable

  • All Implemented Interfaces:
    TextReadable

    public class PathTextReadable
    extends java.lang.Object
    implements TextReadable
    An implementation of TextReadable which delegates to a Path.
    Since:
    3.2-ALPHA-12
    Author:
    Fabrizio Giudici
    Status: stable API
    • Constructor Summary

      Constructors 
      Constructor Description
      PathTextReadable​(java.nio.file.Path path)
      Creates an instance with the given path and options.
      PathTextReadable​(java.nio.file.Path path, java.nio.charset.Charset charset)
      Creates an instance with the given path and options.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Reader openReader()
      Returns a Reader to read from the object.
      • Methods inherited from class java.lang.Object

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

      • PathTextReadable

        public PathTextReadable​(@Nonnull
                                java.nio.file.Path path)
        Creates an instance with the given path and options.
        Parameters:
        path - the path to open
      • PathTextReadable

        public PathTextReadable​(@Nonnull
                                java.nio.file.Path path,
                                @Nonnull
                                java.nio.charset.Charset charset)
        Creates an instance with the given path and options.
        Parameters:
        path - the path to open
        charset - the character set
    • Method Detail

      • openReader

        @Nonnull
        public java.io.Reader openReader()
                                  throws java.io.IOException
        Returns a Reader to read from the object.
        Specified by:
        openReader in interface TextReadable
        Returns:
        the Reader
        Throws:
        java.io.IOException - if the operation can't be performed