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