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 SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents the read session of theLargeText.Source.static interfaceRepresents the data source of this text.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionLargeText(ByteBuffer memory, boolean completed) LargeText(ByteBuffer memory, Charset charset, boolean completed) LargeText(LargeText.Source source, Charset charset, boolean completed) 
- 
Method SummaryModifier 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_PARAMETERFor 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- 
markAsCompletepublic void markAsComplete()
- 
isCompletepublic boolean isComplete()
- 
lengthpublic long length()
- 
readAllReturnsReaderfor reading the raw bytes.- Throws:
- IOException
 
- 
writeLogTo- Throws:
- IOException
 
- 
writeLogToWrites 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 size
- IOException
 
- 
doProgressTextImplements the progressive text handling. This method is used as a "web method" with progressiveText.jelly.- Throws:
- IOException
 
- 
doProgressTextDeprecated.Implements the progressive text handling. This method is used as a "web method" with progressiveText.jelly.- Throws:
- IOException
 
- 
isStreamingRequestDetect use of streaming mode.- Parameters:
- req- The current request.
- Returns:
- true if the new streaming mode is requested.
 
- 
putStreamingMetaAdd additional meta data to a streaming response.- Parameters:
- key- The field to (over)write meta data for.
- value- The meta data value.
 
- 
delegateToWriteLogToWhetherdoProgressText(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
- 
setContentTypeDeprecated.
 
- 
doProgressText(StaplerRequest2, StaplerResponse2)