Package org.simpleframework.http.message
Class PartFactory
java.lang.Object
org.simpleframework.http.message.ConsumerFactory
org.simpleframework.http.message.PartFactory
The
PartFactory
represents a factory for creating the
consumers that are used to read a multipart upload message. This
supports two types of consumers for the multipart upload, lists
and bodies. A part list is basically a collection of parts and or
part lists. The part type is determined from the part header.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
This is the overall length of the parent part series.Fields inherited from class org.simpleframework.http.message.ConsumerFactory
allocator, segment
-
Constructor Summary
ConstructorsConstructorDescriptionPartFactory
(Allocator allocator, Segment header, long length) Constructor for thePartFactory
object. -
Method Summary
Modifier and TypeMethodDescriptiongetInstance
(PartSeries series, byte[] boundary) This method is used to create the consumer given the list and boundary for the part.Methods inherited from class org.simpleframework.http.message.ConsumerFactory
getBoundary, getContentLength, getInstance, getInstance, isChunked, isFixed, isUpload
-
Field Details
-
length
private final long lengthThis is the overall length of the parent part series.
-
-
Constructor Details
-
PartFactory
Constructor for thePartFactory
object. This is used to create a factory using a buffer allocator, which will create a buffer for accumulating the entire message body, also to ensure the correct part type is created this requires the header information for the part.- Parameters:
allocator
- this is used to allocate the internal bufferheader
- this is used to determine the part typelength
- this is the length of the parent part series
-
-
Method Details
-
getInstance
This method is used to create the consumer given the list and boundary for the part. In order to determine the part type this will consult the header consumed for the part. Depending on whether it is a list or body a suitable consumer is created.- Parameters:
series
- this is the list used to collect the partsboundary
- this is the boundary used to terminate the part- Returns:
- this will return the consumer for the part body
-