|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.httpclient.methods.multipart.Part
Abstract class for one Part of a multipart post object.
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 |
Constructor Summary | |
Part()
|
Method Summary | |
static String |
getBoundary()
Return the boundary string. |
abstract String |
getCharSet()
Return the character encoding of this part. |
abstract String |
getContentType()
Return the content type of this part. |
static long |
getLengthOfParts(Part[] parts)
Return the total sum of all parts and that of the last boundary |
abstract String |
getName()
Return the name of this part. |
abstract String |
getTransferEncoding()
Return the transfer encoding of this part. |
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 |
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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected static final String BOUNDARY
protected static final byte[] BOUNDARY_BYTES
protected static final String CRLF
protected static final byte[] CRLF_BYTES
protected static final String QUOTE
protected static final byte[] QUOTE_BYTES
protected static final String EXTRA
protected static final byte[] EXTRA_BYTES
protected static final String CONTENT_DISPOSITION
protected static final byte[] CONTENT_DISPOSITION_BYTES
protected static final String CONTENT_TYPE
protected static final byte[] CONTENT_TYPE_BYTES
protected static final String CHARSET
protected static final byte[] CHARSET_BYTES
protected static final String CONTENT_TRANSFER_ENCODING
protected static final byte[] CONTENT_TRANSFER_ENCODING_BYTES
Constructor Detail |
public Part()
Method Detail |
public static String getBoundary()
public abstract String getName()
public abstract String getContentType()
public abstract String getCharSet()
public abstract String getTransferEncoding()
protected void sendStart(OutputStream out) throws IOException
out
- The output streamprotected void sendDispositionHeader(OutputStream out) throws IOException
out
- The output streamprotected void sendContentTypeHeader(OutputStream out) throws IOException
out
- The output streamprotected void sendTransferEncodingHeader(OutputStream out) throws IOException
out
- The output streamprotected void sendEndOfHeader(OutputStream out) throws IOException
out
- The output streamprotected abstract void sendData(OutputStream out) throws IOException
out
- The output streamprotected abstract long lengthOfData() throws IOException
protected void sendEnd(OutputStream out) throws IOException
out
- The output streampublic void send(OutputStream out) throws IOException
out
- The output streampublic long length() throws IOException
public String toString()
Object.toString()
public static void sendParts(OutputStream out, Part[] parts) throws IOException
out
- The output streamparts
- The array of parts to be sentpublic static long getLengthOfParts(Part[] parts) throws IOException
parts
- The array of parts
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |