Package org.kohsuke.stapler.framework.io
Class LargeText
java.lang.Object
org.kohsuke.stapler.framework.io.LargeText
Represents a large text data.
This class defines methods for handling progressive text update.
Usage
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents the read session of theLargeText.Source.static interfaceRepresents the data source of this text. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLargeText(ByteBuffer memory, boolean completed) LargeText(ByteBuffer memory, Charset charset, boolean completed) LargeText(LargeText.Source source, Charset charset, boolean completed) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanWhetherdoProgressText(StaplerRequest2, StaplerResponse2)should delegate towriteLogTo(long, Writer).voiddoProgressText(StaplerRequest2 req, StaplerResponse2 rsp) Implements the progressive text handling.voiddoProgressText(StaplerRequest req, StaplerResponse rsp) Deprecated.booleanbooleanDetect use of streaming mode.longlength()voidprotected voidputStreamingMeta(String key, Object value) Add additional meta data to a streaming response.readAll()ReturnsReaderfor reading the raw bytes.protected voidDeprecated.protected voidlongwriteLogTo(long start, OutputStream out) Writes the tail portion of the file to theOutputStream.longwriteLogTo(long start, Writer w)
-
Field Details
-
SEARCH_STOP_PARAMETER
For multipart/form-data streaming mode: Enable searching for the first new line character after the provided ?start and abort searching at the given position.- See Also:
-
charset
-
-
Constructor Details
-
LargeText
-
LargeText
- 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
-
LargeText
- 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
-
LargeText
-
LargeText
-
-
Method Details
-
markAsComplete
public void markAsComplete() -
isComplete
public boolean isComplete() -
length
public long length() -
readAll
ReturnsReaderfor reading the raw bytes.- Throws:
IOException
-
writeLogTo
- Throws:
IOException
-
writeLogTo
Writes the tail portion of the file to theOutputStream.- 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 sizeIOException
-
doProgressText
Implements the progressive text handling. This method is used as a "web method" with progressiveText.jelly.- Throws:
IOException
-
doProgressText
Deprecated.Implements the progressive text handling. This method is used as a "web method" with progressiveText.jelly.- Throws:
IOException
-
isStreamingRequest
Detect use of streaming mode.- Parameters:
req- The current request.- Returns:
- true if the new streaming mode is requested.
-
putStreamingMeta
Add additional meta data to a streaming response.- Parameters:
key- The field to (over)write meta data for.value- The meta data value.
-
delegateToWriteLogTo
WhetherdoProgressText(StaplerRequest2, StaplerResponse2)should delegate towriteLogTo(long, Writer).- Returns:
- true if so (more compatible and allows extra HTTP headers to be set, but less efficient); false (default) for efficiency
-
setContentType
-
setContentType
Deprecated.
-
doProgressText(StaplerRequest2, StaplerResponse2)