org.apache.http.entity.mime
Class HttpMultipart
java.lang.Object
org.apache.http.entity.mime.HttpMultipart
public class HttpMultipart
- extends Object
HttpMultipart represents a collection of MIME multipart encoded content bodies. This class is
capable of operating either in the strict (RFC 822, RFC 2045, RFC 2046 compliant) or
the browser compatible modes.
- Since:
- 4.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpMultipart
public HttpMultipart(String subType,
Charset charset,
String boundary)
HttpMultipart
public HttpMultipart(String subType,
String boundary)
getSubType
public String getSubType()
getCharset
public Charset getCharset()
getMode
public HttpMultipartMode getMode()
setMode
public void setMode(HttpMultipartMode mode)
getBodyParts
public List<FormBodyPart> getBodyParts()
addBodyPart
public void addBodyPart(FormBodyPart part)
getBoundary
public String getBoundary()
writeTo
public void writeTo(OutputStream out)
throws IOException
- Writes out the content in the multipart/form encoding. This method
produces slightly different formatting depending on its compatibility
mode.
- Throws:
IOException
- See Also:
getMode()
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 the @{link BodyPart}s 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.
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.