Package org.frankframework.http.mime
Class MultipartForm
java.lang.Object
org.frankframework.http.mime.MultipartForm
HttpMultipart represents a collection of MIME multipart encoded content bodies.
-
Constructor Summary
ConstructorDescriptionMultipartForm
(Charset charset, String boundary, List<org.apache.http.entity.mime.FormBodyPart> parts) Creates an instance with the specified settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
formatMultipartHeader
(org.apache.http.entity.mime.FormBodyPart part, OutputStream out) Write the multipart header fields; depends on the style.List<org.apache.http.entity.mime.FormBodyPart>
long
Determines the total length of the multipart content (content length of individual parts plus that of extra elements required to delimit the parts from one another).boolean
protected static void
writeField
(org.apache.http.entity.mime.MinimalField field, OutputStream out) protected static void
writeField
(org.apache.http.entity.mime.MinimalField field, Charset charset, OutputStream out) void
writeTo
(OutputStream out) Writes out the content in the specified multipart encoding.
-
Constructor Details
-
MultipartForm
public MultipartForm(Charset charset, String boundary, List<org.apache.http.entity.mime.FormBodyPart> parts) Creates an instance with the specified settings.- Parameters:
charset
- the character set to use. May benull
, in which caseMIME.DEFAULT_CHARSET
- i.e. US-ASCII - is used.boundary
- to use - must not benull
- Throws:
IllegalArgumentException
- if charset is null or boundary is null
-
-
Method Details
-
writeField
protected static void writeField(org.apache.http.entity.mime.MinimalField field, OutputStream out) throws IOException - Throws:
IOException
-
writeField
protected static void writeField(org.apache.http.entity.mime.MinimalField field, Charset charset, OutputStream out) throws IOException - Throws:
IOException
-
getBodyParts
-
formatMultipartHeader
protected void formatMultipartHeader(org.apache.http.entity.mime.FormBodyPart part, OutputStream out) throws IOException Write the multipart header fields; depends on the style.- Throws:
IOException
-
writeTo
Writes out the content in the specified multipart encoding. This method produces slightly different formatting depending on its compatibility mode.- Throws:
IOException
-
getTotalLength
public long getTotalLength()Determines the total length of the multipart content (content length of individual parts plus that of extra elements required to delimit the parts from one another). If any of theBodyParts
contained in this object is of a streaming entity of unknown length the total length is also unknown.This method buffers only a small amount of data in order to determine the total length of the entire entity. The content of individual parts is not buffered.
- Returns:
- total length of the multipart entity if known,
-1
otherwise.
-
isRepeatable
public boolean isRepeatable()
-