public class HttpMultipart extends Object
Constructor and Description |
---|
HttpMultipart(String subType,
Charset charset,
String boundary)
Creates an instance with the specified settings.
|
HttpMultipart(String subType,
Charset charset,
String boundary,
HttpMultipartMode mode)
Creates an instance with the specified settings.
|
HttpMultipart(String subType,
String boundary) |
Modifier and Type | Method and Description |
---|---|
void |
addBodyPart(FormBodyPart part) |
List<FormBodyPart> |
getBodyParts() |
String |
getBoundary() |
Charset |
getCharset() |
HttpMultipartMode |
getMode() |
String |
getSubType() |
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).
|
void |
writeTo(OutputStream out)
Writes out the content in the multipart/form encoding.
|
public HttpMultipart(String subType, Charset charset, String boundary, HttpMultipartMode mode)
subType
- mime subtype - must not be null
charset
- the character set to use. May be null
, in which case MIME.DEFAULT_CHARSET
- i.e. US-ASCII - is used.boundary
- to use - must not be null
mode
- the mode to useIllegalArgumentException
- if charset is null or boundary is nullpublic HttpMultipart(String subType, Charset charset, String boundary)
HttpMultipartMode.STRICT
subType
- mime subtype - must not be null
charset
- the character set to use. May be null
, in which case MIME.DEFAULT_CHARSET
- i.e. US-ASCII - is used.boundary
- to use - must not be null
IllegalArgumentException
- if charset is null or boundary is nullpublic String getSubType()
public Charset getCharset()
public HttpMultipartMode getMode()
public List<FormBodyPart> getBodyParts()
public void addBodyPart(FormBodyPart part)
public String getBoundary()
public void writeTo(OutputStream out) throws IOException
IOException
getMode()
public long getTotalLength()
-1
otherwise.Copyright © 1999–2014 The Apache Software Foundation. All rights reserved.