public abstract class PartBase extends Object implements Part
CHARSET_BYTES, CONTENT_DISPOSITION_BYTES, CONTENT_ID_BYTES, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE_BYTES, CRLF_BYTES, EXTRA_BYTES, FORM_DATA_DISPOSITION_TYPE_BYTES, NAME_BYTES, QUOTE_BYTE| Constructor and Description |
|---|
PartBase(String name,
String contentType,
Charset charset,
String contentId) |
PartBase(String name,
String contentType,
Charset charset,
String contentId,
String transferEncoding)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Charset |
getCharset()
Return the character encoding of this part.
|
String |
getContentId()
Return the content ID of this part.
|
String |
getContentType()
Returns the content type of this part.
|
protected abstract long |
getDataLength() |
String |
getDispositionType()
Gets the disposition-type to be used in Content-Disposition header
|
String |
getName()
Return the name of this part.
|
String |
getTransferEncoding()
Return the transfer encoding of this part.
|
long |
length(byte[] boundary)
Return the full length of all the data.
|
protected abstract void |
sendData(OutputStream out) |
void |
setDispositionType(String dispositionType) |
String |
toString() |
protected void |
visitContentIdHeader(PartVisitor visitor) |
protected void |
visitContentTypeHeader(PartVisitor visitor) |
protected void |
visitDispositionHeader(PartVisitor visitor) |
protected void |
visitEnd(PartVisitor visitor) |
protected void |
visitEndOfHeader(PartVisitor visitor) |
protected void |
visitStart(PartVisitor visitor,
byte[] boundary) |
protected void |
visitTransferEncodingHeader(PartVisitor visitor) |
void |
write(OutputStream out,
byte[] boundary)
Write all the data to the output stream.
|
public PartBase(String name, String contentType, Charset charset, String contentId, String transferEncoding)
name - The name of the part, or nullcontentType - The content type, or nullcharset - The character encoding, or nullcontentId - The content id, or nulltransferEncoding - The transfer encoding, or nullprotected void visitStart(PartVisitor visitor, byte[] boundary) throws IOException
IOExceptionprotected void visitDispositionHeader(PartVisitor visitor) throws IOException
IOExceptionprotected void visitContentTypeHeader(PartVisitor visitor) throws IOException
IOExceptionprotected void visitTransferEncodingHeader(PartVisitor visitor) throws IOException
IOExceptionprotected void visitContentIdHeader(PartVisitor visitor) throws IOException
IOExceptionprotected void visitEndOfHeader(PartVisitor visitor) throws IOException
IOExceptionprotected void visitEnd(PartVisitor visitor) throws IOException
IOExceptionprotected abstract long getDataLength()
protected abstract void sendData(OutputStream out) throws IOException
IOExceptionpublic void write(OutputStream out, byte[] boundary) throws IOException
write in interface Partout - The output streamboundary - the boundaryIOException - If an IO problem occurs.public long length(byte[] boundary)
public String getName()
Partpublic String getContentType()
PartgetContentType in interface Partnull to exclude the content type headerpublic Charset getCharset()
PartgetCharset in interface Partnull to exclude the character encoding headerpublic String getTransferEncoding()
PartgetTransferEncoding in interface Partnull to exclude the transfer encoding headerpublic String getContentId()
PartgetContentId in interface Partnull to exclude the content ID headerpublic String getDispositionType()
PartgetDispositionType in interface Partpublic void setDispositionType(String dispositionType)
Copyright © 2014. All Rights Reserved.