Class MixedContent
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.batch.Batch<MultipartContent>
-
- de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.MixedContent
-
- All Implemented Interfaces:
Content,MultipartContent
public class MixedContent extends Batch<MultipartContent> implements MultipartContent
Parser for multipart/mixed mime type stringContent, since Tomcat only handles multipart/form-data.- Author:
- scf
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.MultipartContent
MultipartContent.IsFinished
-
-
Field Summary
Fields Modifier and Type Field Description static PatternBOUNDARY_PATTERNstatic StringBOUNDARY_REGEXstatic PatternHEADER_PATTERNstatic StringHEADER_REGEXstatic PatternSUB_HEADER_PATTERNstatic StringSUB_HEADER_REGEX-
Fields inherited from class de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.batch.Batch
batchVersion, errors, isChangeSet, logIndent, parseFailed, parts, settings
-
-
Constructor Summary
Constructors Constructor Description MixedContent(de.fraunhofer.iosb.ilt.frostserver.path.Version batchVersion, CoreSettings settings, boolean isChangeSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContent(boolean allHeaders)Get the String content for response.Map<String,String>getHeaders()Get the headers.MultipartContent.IsFinishedisFinished()Gives the parse-state of the Content.booleanparse(ServiceRequest request)voidparseLine(String line)Add the line to the content.voidparseLineInternal(String line)MixedContentsetBoundaryHeader(String boundaryHeader)voidstripLastNewline()Informs the Content that the last newline should be removed again.-
Methods inherited from class de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.batch.Batch
addPart, getErrors, getParts, isParseFailed, setLogIndent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.batch.Content
getErrors, isParseFailed, setLogIndent
-
-
-
-
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(de.fraunhofer.iosb.ilt.frostserver.path.Version batchVersion, CoreSettings settings, boolean isChangeSet)
-
-
Method Detail
-
parse
public boolean parse(ServiceRequest request)
- Specified by:
parsein classBatch<MultipartContent>
-
setBoundaryHeader
public MixedContent setBoundaryHeader(String boundaryHeader)
-
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.
-
parseLineInternal
public void parseLineInternal(String line)
-
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.
-
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.
-
-