public class ByteSourceMailPart extends AbstractMailPart implements MailPart, DataSource
MailMessage.release() calls MailPart.close() on all the parts in the message.| Modifier and Type | Field and Description |
|---|---|
(package private) static org.apache.logging.log4j.Logger |
_logger
Logger.
|
| Constructor and Description |
|---|
ByteSourceMailPart(ByteSource partData,
String desc,
String type,
String disp)
Creates a mail part.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Cleans up any resources used by the mail part.
|
ByteSourceMailPart |
createCopy()
Clone the mail part.
|
protected void |
finalize() |
InputStream |
getInputStream()
Gets the content as an InputStream.
|
String |
getName() |
OutputStream |
getOutputStream() |
contentToString, getContentDisposition, getContentID, getContentLocation, getContentType, getDescription, setContentDisposition, setContentID, setContentLocation, setContentType, setDescription, toStringclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetContentDisposition, getContentID, getContentLocation, getContentType, getDescriptiongetContentTypepublic ByteSourceMailPart(ByteSource partData, @Nullable String desc, String type, String disp) throws IOException
partData - the part data/attachment.desc - Description of attachment.type - The content type of the attachment. Examples: "text/plain", "audio/basic", "video/mpeg" . Requireddisp - This content disposition of the attachment. Examples: "inline", "attachment", "attachment;
filename=mydocument.doc"IOException - if an error occurs accessing the input stream.public void close()
MailPartpublic ByteSourceMailPart createCopy() throws IOException
MailPartcreateCopy in interface MailPartIOException - on error.protected void finalize()
throws Throwable
public InputStream getInputStream() throws IOException
MailPartgetInputStream in interface DataSourcegetInputStream in interface MailPartcloseed.IOException - if an error occurs creating the input stream.public String getName()
getName in interface DataSourcepublic OutputStream getOutputStream() throws IOException
getOutputStream in interface DataSourceIOException