Class PathTextWritable

  • All Implemented Interfaces:
    TextWritable

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Writer openWriter()
      Returns a Writer to write into the object.
      • Methods inherited from class java.lang.Object

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

      • PathTextWritable

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

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

      • openWriter

        @Nonnull
        public java.io.Writer openWriter()
                                  throws java.io.IOException
        Returns a Writer to write into the object.
        Specified by:
        openWriter in interface TextWritable
        Returns:
        the Writer
        Throws:
        java.io.IOException - if the operation can't be performed