Package ej.hoka.http.body
Class MultiPartBodyParser
- java.lang.Object
-
- ej.hoka.http.body.MultiPartBodyParser
-
- All Implemented Interfaces:
BodyParser<MultiPartBodyParser.MultiPartBody>
public class MultiPartBodyParser extends java.lang.Object implements BodyParser<MultiPartBodyParser.MultiPartBody>
A body parser forMime.MIME_MULTIPART_FORM_ENCODED_DATA. It uses a buffer, typically useful when the content of a file is uploaded. Default size is 4096 bytes but can be changed using the "hoka.buffer.size" property.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiPartBodyParser.MultiPartBodyClass representing the collection ofHttpPartin the request.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBOUNDARYThe boundary delimiter.
-
Constructor Summary
Constructors Constructor Description MultiPartBodyParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiPartBodyParser.MultiPartBodyparseBody(java.io.InputStream inputStream, java.lang.String contentType)Initialize the parsing, must be called beforeMultiPartBodyParser.MultiPartBody.nextPart().
-
-
-
Field Detail
-
BOUNDARY
public static final java.lang.String BOUNDARY
The boundary delimiter.- See Also:
- Constant Field Values
-
-
Method Detail
-
parseBody
public MultiPartBodyParser.MultiPartBody parseBody(java.io.InputStream inputStream, @Nullable java.lang.String contentType) throws java.io.IOException
Initialize the parsing, must be called beforeMultiPartBodyParser.MultiPartBody.nextPart(). This function does not consume theinputStream.- Specified by:
parseBodyin interfaceBodyParser<MultiPartBodyParser.MultiPartBody>- Parameters:
inputStream- the bodyInputStream.contentType- the"content-type"header of the request.- Returns:
- the body.
- Throws:
java.io.IOException- when anIOExceptionoccurs during the parsing.
-
-