Class StringContent
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.StringContent
-
- All Implemented Interfaces:
Content,MultipartContent
public class StringContent extends Object implements MultipartContent
Content with no content type.- Author:
- scf
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.MultipartContent
MultipartContent.IsFinished
-
-
Constructor Summary
Constructors Constructor Description StringContent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContent(boolean allHeaders)Get the String content for response.List<String>getErrors()Get the list of error messages generating during parsing.Map<String,String>getHeaders()Get the headers.MultipartContent.IsFinishedisFinished()Gives the parse-state of the Content.booleanisParseFailed()Flag indicating there were errors parsing the content.voidparseLine(String line)Add the line to the content.voidsetContent(StringBuilder content)voidsetLogIndent(String logIndent)Sets the indentation of log messages.voidstripLastNewline()Informs the Content that the last newline should be removed again.
-
-
-
Method Detail
-
parseLine
public void parseLine(String line)
Description copied from interface:MultipartContentAdd the line to the content.- Specified by:
parseLinein interfaceMultipartContent- Parameters:
line- The line to add.
-
isParseFailed
public boolean isParseFailed()
Description copied from interface:ContentFlag indicating there were errors parsing the content.- Specified by:
isParseFailedin interfaceContent- Returns:
- true if there were parse errors.
-
getErrors
public List<String> getErrors()
Description copied from interface:ContentGet the list of error messages generating during parsing.
-
stripLastNewline
public void stripLastNewline()
Description copied from interface:MultipartContentInforms the Content that the last newline should be removed again. The newline before a boundary is part of the boundary, not of the content.- Specified by:
stripLastNewlinein interfaceMultipartContent
-
isFinished
public MultipartContent.IsFinished isFinished()
Description copied from interface:MultipartContentGives the parse-state of the Content. This indicates if more content is expected or not.- Specified by:
isFinishedin interfaceMultipartContent- Returns:
- the parse-state of the Content.
-
setLogIndent
public void setLogIndent(String logIndent)
Description copied from interface:ContentSets the indentation of log messages. Since Content can be nested, this makes debug output better readable.- Specified by:
setLogIndentin interfaceContent- Parameters:
logIndent- the indentation of log messages.
-
getContent
public String getContent(boolean allHeaders)
Description copied from interface:ContentGet the String content for response.- Specified by:
getContentin interfaceContent- Parameters:
allHeaders- flag indicating all headers should be included. If the content is going to be added to a HttpServletResponse, the headers need to be set separately.- Returns:
- The content.
-
setContent
public void setContent(StringBuilder content)
-
-