Class MixedContent
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.MixedContent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.Content
Content.IsFinished
-
-
Field Summary
Fields Modifier and Type Field Description static PatternBOUNDARY_PATTERNstatic StringBOUNDARY_REGEXstatic PatternHEADER_PATTERNstatic StringHEADER_REGEXstatic PatternSUB_HEADER_PATTERNstatic StringSUB_HEADER_REGEX
-
Constructor Summary
Constructors Constructor Description MixedContent(CoreSettings settings, boolean isChangeSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MixedContentaddPart(Part part)StringgetContent(boolean allHeaders)Get the String content.List<String>getErrors()Get the list of error messages generating during parsing.Map<String,String>getHeaders()Get the headers.List<Part>getParts()Content.IsFinishedisFinished()Gives the parse-state of the Content.booleanisParseFailed()Flag indicating there were errors parsing the content.booleanparse(ServiceRequest request)voidparseLine(String line)Add the line to the content.voidparseLineInternal(String line)MixedContentsetBoundaryHeader(String boundaryHeader)voidsetLogIndent(String logIndent)Sets the indentation of log messages.voidstripLastNewline()Informs the Content that the last newline should be removed again.
-
-
-
Field Detail
-
BOUNDARY_REGEX
public static final String BOUNDARY_REGEX
- See Also:
- Constant Field Values
-
BOUNDARY_PATTERN
public static final Pattern BOUNDARY_PATTERN
-
HEADER_REGEX
public static final String HEADER_REGEX
- See Also:
- Constant Field Values
-
HEADER_PATTERN
public static final Pattern HEADER_PATTERN
-
SUB_HEADER_REGEX
public static final String SUB_HEADER_REGEX
- See Also:
- Constant Field Values
-
SUB_HEADER_PATTERN
public static final Pattern SUB_HEADER_PATTERN
-
-
Constructor Detail
-
MixedContent
public MixedContent(CoreSettings settings, boolean isChangeSet)
-
-
Method Detail
-
parse
public boolean parse(ServiceRequest request)
-
setBoundaryHeader
public MixedContent setBoundaryHeader(String boundaryHeader)
-
parseLine
public void parseLine(String line)
Description copied from interface:ContentAdd the line to the content.
-
parseLineInternal
public void parseLineInternal(String line)
-
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:ContentInforms 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 interfaceContent
-
isFinished
public Content.IsFinished isFinished()
Description copied from interface:ContentGives the parse-state of the Content. This indicates if more content is expected or not.- Specified by:
isFinishedin interfaceContent- 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.
-
addPart
public MixedContent addPart(Part part)
-
getContent
public String getContent(boolean allHeaders)
Description copied from interface:ContentGet the String content.- 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.
-
-