public class MimeEntity
extends javax.mail.internet.MimeBodyPart
| Constructor and Description |
|---|
MimeEntity()
Constructs an empty MIME entity.
|
MimeEntity(InputStream inStream)
Constructs a message from input stream containing the entire message.
|
MimeEntity(javax.mail.internet.InternetHeaders headers,
byte[] content)
Constructs a MimeEntity with the provided headers and message body.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContentAsBytes()
Gets the content (body) of the entity as a byte array.
|
boolean |
isMultiPart()
Indicates if the entity is MIME multipart entity.
|
String |
toString() |
void |
verifyContentType(javax.mail.internet.ContentType expectedType)
Verifies if the content type of the entity is what is expected.
|
void |
verifyContentType(String expectedType)
Verifies if the content type of the entity is what is expected.
|
void |
verifyTransferEncoding(String expectedEncoding)
Verifies if the transfer encoding of the entity is what is expected.
|
addHeader, addHeaderLine, attachFile, attachFile, getAllHeaderLines, getAllHeaders, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getSize, isMimeType, removeHeader, saveFile, saveFile, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setHeader, setText, setText, setText, writeTopublic MimeEntity()
public MimeEntity(javax.mail.internet.InternetHeaders headers,
byte[] content)
throws javax.mail.MessagingException
headers - Collection of headers to apply to the message.content - The message's body.javax.mail.MessagingExceptionpublic MimeEntity(InputStream inStream) throws javax.mail.MessagingException
inStream - An input stream containing the entire content (headers and content) of the message.javax.mail.MessagingExceptionpublic boolean isMultiPart()
public void verifyContentType(String expectedType) throws MimeException
expectedType - The content type of the entity that is expected.ProtocolException - Thrown if the entity's content type does not match the expected type.MimeExceptionpublic void verifyContentType(javax.mail.internet.ContentType expectedType)
throws MimeException
expectedType - The content type of the entity that is expected.ProtocolException - Thrown if the entity's content type does not match the expected type.MimeExceptionpublic void verifyTransferEncoding(String expectedEncoding) throws MimeException
expectedEncoding - The transfer encoding of the entity that is expected.ProtocolException - Thrown if the entity's transfer encoding does not match the expected encoding.MimeExceptionpublic byte[] getContentAsBytes()
Copyright © 2010-2016 NHIN Direct. All Rights Reserved.