abstract class AbstractMultipartForm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
boundary |
(package private) java.nio.charset.Charset |
charset |
private static org.apache.http.util.ByteArrayBuffer |
CR_LF |
private static org.apache.http.util.ByteArrayBuffer |
FIELD_SEP |
private static org.apache.http.util.ByteArrayBuffer |
TWO_DASHES |
Constructor and Description |
---|
AbstractMultipartForm(java.nio.charset.Charset charset,
java.lang.String boundary)
Creates an instance with the specified settings.
|
AbstractMultipartForm(java.lang.String boundary) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
doWriteTo(java.io.OutputStream out,
boolean writeContent) |
private static org.apache.http.util.ByteArrayBuffer |
encode(java.nio.charset.Charset charset,
java.lang.String string) |
protected abstract void |
formatMultipartHeader(FormBodyPart part,
java.io.OutputStream out)
Write the multipart header fields; depends on the style.
|
abstract java.util.List<FormBodyPart> |
getBodyParts() |
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).
|
private static void |
writeBytes(org.apache.http.util.ByteArrayBuffer b,
java.io.OutputStream out) |
private static void |
writeBytes(java.lang.String s,
java.nio.charset.Charset charset,
java.io.OutputStream out) |
private static void |
writeBytes(java.lang.String s,
java.io.OutputStream out) |
protected static void |
writeField(MinimalField field,
java.nio.charset.Charset charset,
java.io.OutputStream out) |
protected static void |
writeField(MinimalField field,
java.io.OutputStream out) |
void |
writeTo(java.io.OutputStream out)
Writes out the content in the multipart/form encoding.
|
private static final org.apache.http.util.ByteArrayBuffer FIELD_SEP
private static final org.apache.http.util.ByteArrayBuffer CR_LF
private static final org.apache.http.util.ByteArrayBuffer TWO_DASHES
final java.nio.charset.Charset charset
final java.lang.String boundary
public AbstractMultipartForm(java.nio.charset.Charset charset, java.lang.String boundary)
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
java.lang.IllegalArgumentException
- if charset is null or boundary is nullpublic AbstractMultipartForm(java.lang.String boundary)
private static org.apache.http.util.ByteArrayBuffer encode(java.nio.charset.Charset charset, java.lang.String string)
private static void writeBytes(org.apache.http.util.ByteArrayBuffer b, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
private static void writeBytes(java.lang.String s, java.nio.charset.Charset charset, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
private static void writeBytes(java.lang.String s, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
protected static void writeField(MinimalField field, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
protected static void writeField(MinimalField field, java.nio.charset.Charset charset, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public abstract java.util.List<FormBodyPart> getBodyParts()
void doWriteTo(java.io.OutputStream out, boolean writeContent) throws java.io.IOException
java.io.IOException
protected abstract void formatMultipartHeader(FormBodyPart part, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public long getTotalLength()
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.
-1
otherwise.