public class LargeText
extends java.lang.Object
This class defines methods for handling progressive text update.
Modifier and Type | Field and Description |
---|---|
protected java.nio.charset.Charset |
charset |
Constructor and Description |
---|
LargeText(ByteBuffer memory,
boolean completed) |
LargeText(ByteBuffer memory,
java.nio.charset.Charset charset,
boolean completed) |
LargeText(java.io.File file,
boolean completed) |
LargeText(java.io.File file,
boolean completed,
boolean transparentGunzip) |
LargeText(java.io.File file,
java.nio.charset.Charset charset,
boolean completed) |
LargeText(java.io.File file,
java.nio.charset.Charset charset,
boolean completed,
boolean transparentGunzip) |
Modifier and Type | Method and Description |
---|---|
protected java.io.Writer |
createWriter(StaplerRequest req,
StaplerResponse rsp,
long size) |
void |
doProgressText(StaplerRequest req,
StaplerResponse rsp)
Implements the progressive text handling.
|
boolean |
isComplete() |
long |
length() |
void |
markAsComplete() |
java.io.Reader |
readAll()
Returns
Reader for reading the raw bytes. |
protected void |
setContentType(StaplerResponse rsp) |
long |
writeLogTo(long start,
java.io.OutputStream out)
Writes the tail portion of the file to the
OutputStream . |
long |
writeLogTo(long start,
java.io.Writer w) |
public LargeText(java.io.File file, boolean completed)
public LargeText(java.io.File file, boolean completed, boolean transparentGunzip)
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.public LargeText(java.io.File file, java.nio.charset.Charset charset, boolean completed)
public LargeText(java.io.File file, java.nio.charset.Charset charset, boolean completed, boolean transparentGunzip)
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.public LargeText(ByteBuffer memory, boolean completed)
public LargeText(ByteBuffer memory, java.nio.charset.Charset charset, boolean completed)
public void markAsComplete()
public boolean isComplete()
public long length()
public java.io.Reader readAll() throws java.io.IOException
Reader
for reading the raw bytes.java.io.IOException
public long writeLogTo(long start, java.io.Writer w) throws java.io.IOException
java.io.IOException
public long writeLogTo(long start, java.io.OutputStream out) throws java.io.IOException
OutputStream
.start
- The byte offset in the input file where the write operation starts.java.io.IOException
public void doProgressText(StaplerRequest req, StaplerResponse rsp) throws java.io.IOException
java.io.IOException
protected void setContentType(StaplerResponse rsp)
protected java.io.Writer createWriter(StaplerRequest req, StaplerResponse rsp, long size) throws java.io.IOException
java.io.IOException
Copyright © 2013. All Rights Reserved.