Class LargeText

java.lang.Object
org.kohsuke.stapler.framework.io.LargeText

public class LargeText extends Object
Represents a large text data.

This class defines methods for handling progressive text update.

Usage

Author:
Kohsuke Kawaguchi
  • Field Details

    • charset

      protected final Charset charset
  • Constructor Details

    • LargeText

      public LargeText(File file, boolean completed)
    • LargeText

      public LargeText(File file, boolean completed, boolean transparentGunzip)
      Parameters:
      transparentGunzip - if set to true, this class will detect if the given file is compressed with GZIP. If so, it will transparently uncompress its content during read-access. Do note that the underlying file is not altered and remains compressed.
      Since:
      1.196
    • LargeText

      public LargeText(File file, Charset charset, boolean completed)
    • LargeText

      public LargeText(File file, Charset charset, boolean completed, boolean transparentGunzip)
      Parameters:
      transparentGunzip - if set to true, this class will detect if the given file is compressed with GZIP. If so, it will transparently uncompress its content during read-access. Do note that the underlying file is not altered and remains compressed.
      Since:
      1.196
    • LargeText

      public LargeText(ByteBuffer memory, boolean completed)
    • LargeText

      public LargeText(ByteBuffer memory, Charset charset, boolean completed)
  • Method Details

    • markAsComplete

      public void markAsComplete()
    • isComplete

      public boolean isComplete()
    • length

      public long length()
    • readAll

      public Reader readAll() throws IOException
      Returns Reader for reading the raw bytes.
      Throws:
      IOException
    • writeLogTo

      public long writeLogTo(long start, Writer w) throws IOException
      Throws:
      IOException
    • writeLogTo

      public long writeLogTo(long start, OutputStream out) throws IOException
      Writes the tail portion of the file to the OutputStream.
      Parameters:
      start - The byte offset in the input file where the write operation starts.
      Returns:
      if the file is still being written, this method writes the file until the last newline character and returns the offset to start the next write operation.
      Throws:
      EOFException - if the start position is larger than the file size
      IOException
    • doProgressText

      public void doProgressText(StaplerRequest req, StaplerResponse rsp) throws IOException
      Implements the progressive text handling. This method is used as a "web method" with progressiveText.jelly.
      Throws:
      IOException
    • setContentType

      protected void setContentType(StaplerResponse rsp)
    • createWriter

      protected Writer createWriter(StaplerRequest req, StaplerResponse rsp, long size) throws IOException
      Throws:
      IOException