Class HttpMultipart
- java.lang.Object
-
- com.foxinmy.weixin4j.http.apache.mime.HttpMultipart
-
@Deprecated public class HttpMultipart extends Object
Deprecated.(4.3) UseMultipartEntityBuilder
.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
-
-
Constructor Summary
Constructors Constructor Description HttpMultipart(String subType, String boundary)
Deprecated.HttpMultipart(String subType, Charset charset, String boundary)
Deprecated.Creates an instance with the specified settings.HttpMultipart(String subType, Charset charset, String boundary, HttpMultipartMode mode)
Deprecated.Creates an instance with the specified settings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addBodyPart(FormBodyPart part)
Deprecated.protected void
formatMultipartHeader(FormBodyPart part, OutputStream out)
Deprecated.Write the multipart header fields; depends on the style.List<FormBodyPart>
getBodyParts()
Deprecated.String
getBoundary()
Deprecated.Charset
getCharset()
Deprecated.HttpMultipartMode
getMode()
Deprecated.String
getSubType()
Deprecated.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).protected static void
writeField(MinimalField field, OutputStream out)
protected static void
writeField(MinimalField field, Charset charset, OutputStream out)
void
writeTo(OutputStream out)
Writes out the content in the multipart/form encoding.
-
-
-
Constructor Detail
-
HttpMultipart
public HttpMultipart(String subType, Charset charset, String boundary, HttpMultipartMode mode)
Deprecated.Creates an instance with the specified settings.- Parameters:
subType
- MIME subtype - must not benull
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
mode
- the mode to use- Throws:
IllegalArgumentException
- if charset is null or boundary is null
-
HttpMultipart
public HttpMultipart(String subType, Charset charset, String boundary)
Deprecated.Creates an instance with the specified settings. Mode is set toHttpMultipartMode.STRICT
- Parameters:
subType
- MIME subtype - must not benull
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 Detail
-
getMode
public HttpMultipartMode getMode()
Deprecated.
-
formatMultipartHeader
protected void formatMultipartHeader(FormBodyPart part, OutputStream out) throws IOException
Deprecated.Write the multipart header fields; depends on the style.- Throws:
IOException
-
getBodyParts
public List<FormBodyPart> getBodyParts()
Deprecated.
-
addBodyPart
public void addBodyPart(FormBodyPart part)
Deprecated.
-
getSubType
public String getSubType()
Deprecated.
-
getCharset
public Charset getCharset()
Deprecated.
-
getBoundary
public String getBoundary()
Deprecated.
-
writeField
protected static void writeField(MinimalField field, OutputStream out) throws IOException
- Throws:
IOException
-
writeField
protected static void writeField(MinimalField field, Charset charset, OutputStream out) throws IOException
- Throws:
IOException
-
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
-
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.
-
-