org.apache.commons.httpclient.methods.multipart
public abstract class Part extends Object
Since: 2.0
Field Summary | |
---|---|
protected static String | BOUNDARY
The boundary |
protected static byte[] | BOUNDARY_BYTES
The boundary as a byte array. |
protected static String | CHARSET Content charset |
protected static byte[] | CHARSET_BYTES Content charset as a byte array |
protected static String | CONTENT_DISPOSITION Content dispostion characters |
protected static byte[] | CONTENT_DISPOSITION_BYTES Content dispostion as a byte array |
protected static String | CONTENT_TRANSFER_ENCODING Content type header |
protected static byte[] | CONTENT_TRANSFER_ENCODING_BYTES Content type header as a byte array |
protected static String | CONTENT_TYPE Content type header |
protected static byte[] | CONTENT_TYPE_BYTES Content type header as a byte array |
protected static String | CRLF Carriage return/linefeed |
protected static byte[] | CRLF_BYTES Carriage return/linefeed as a byte array |
protected static String | EXTRA Extra characters |
protected static byte[] | EXTRA_BYTES Extra characters as a byte array |
protected static String | QUOTE Content dispostion characters |
protected static byte[] | QUOTE_BYTES Content dispostion as a byte array |
Method Summary | |
---|---|
static String | getBoundary()
Return the boundary string. |
abstract String | getCharSet()
Return the character encoding of this part. |
abstract String | getContentType()
Returns the content type of this part. |
static long | getLengthOfParts(Part[] parts)
Return the total sum of all parts and that of the last boundary
|
static long | getLengthOfParts(Part[] parts, byte[] partBoundary)
Gets the length of the multipart message including the given parts.
|
abstract String | getName()
Return the name of this part. |
protected byte[] | getPartBoundary()
Gets the part boundary to be used. |
abstract String | getTransferEncoding()
Return the transfer encoding of this part. |
boolean | isRepeatable()
Tests if this part can be sent more than once. |
long | length()
Return the full length of all the data.
|
protected abstract long | lengthOfData()
Return the length of the main content
|
void | send(OutputStream out)
Write all the data to the output stream.
|
protected void | sendContentTypeHeader(OutputStream out)
Write the content type header to the specified output stream |
protected abstract void | sendData(OutputStream out)
Write the data to the specified output stream |
protected void | sendDispositionHeader(OutputStream out)
Write the content disposition header to the specified output stream
|
protected void | sendEnd(OutputStream out)
Write the end data to the output stream. |
protected void | sendEndOfHeader(OutputStream out)
Write the end of the header to the output stream |
static void | sendParts(OutputStream out, Part[] parts)
Write all parts and the last boundary to the specified output stream.
|
static void | sendParts(OutputStream out, Part[] parts, byte[] partBoundary)
Write all parts and the last boundary to the specified output stream.
|
protected void | sendStart(OutputStream out)
Write the start to the specified output stream |
protected void | sendTransferEncodingHeader(OutputStream out)
Write the content transfer encoding header to the specified
output stream
|
String | toString()
Return a string representation of this object. |
Deprecated: use {@link org.apache.commons.httpclient.params.HttpMethodParams#MULTIPART_BOUNDARY}
The boundaryDeprecated:
The boundary as a byte array.Deprecated: uses a constant string. Rather use {@link #getPartBoundary}
Return the boundary string.Returns: the boundary string
Returns: the character encoding, or null
to exclude the character
encoding header
Returns: the content type, or null
to exclude the content type header
Parameters: parts The parts.
Returns: The total length
Throws: IOException If an I/O error occurs while writing the parts.
Parameters: parts The parts. partBoundary The ASCII bytes to use as the part boundary.
Returns: The total length
Throws: IOException If an I/O error occurs while writing the parts.
Since: 3.0
Returns: The name.
Returns: the part boundary as an array of bytes.
Since: 3.0
Returns: the transfer encoding, or null
to exclude the transfer encoding header
Returns: true
if {@link #sendData(OutputStream)} can be successfully called
more than once.
Since: 3.0
Returns: long The length.
Throws: IOException If an IO problem occurs
Returns: long The length.
Throws: IOException If an IO problem occurs
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The stream to write to. parts The parts to write.
Throws: IOException If an I/O error occurs while writing the parts.
Parameters: out The stream to write to. parts The parts to write. partBoundary The ASCII bytes to use as the part boundary.
Throws: IOException If an I/O error occurs while writing the parts.
Since: 3.0
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Parameters: out The output stream
Throws: IOException If an IO problem occurs.
Returns: A string representation of this object.
See Also: java.lang.Object#toString()