Package org.apache.poi.hmef
Class Attachment
java.lang.Object
org.apache.poi.hmef.Attachment
An attachment within a
HMEFMessage
. Provides both helper
methods to get at common parts and attributes of the attachment,
and list methods to get all of them.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttribute
(TNEFAttribute attr) Return the attachment attribute with the given ID, or null if there isn't one.Returns all HMEF/TNEF attributes of the attachment, such as filename, icon and contentsbyte[]
Returns the contents of the attachment.Returns the file extensionReturns the short filenameReturns the long filenameReturn the attachment MAPI Attribute with the given ID, or null if there isn't one.Returns all MAPI attributes of the attachment, such as extension, encoding, size and positionReturn when the file was last modified, if known.byte[]
Returns the Meta File rendered representation of the attachment, or null if not set.
-
Constructor Details
-
Attachment
public Attachment()
-
-
Method Details
-
addAttribute
-
getAttribute
Return the attachment attribute with the given ID, or null if there isn't one. -
getMAPIAttribute
Return the attachment MAPI Attribute with the given ID, or null if there isn't one. -
getAttributes
Returns all HMEF/TNEF attributes of the attachment, such as filename, icon and contents -
getMAPIAttributes
Returns all MAPI attributes of the attachment, such as extension, encoding, size and position -
getFilename
Returns the short filename -
getLongFilename
Returns the long filename -
getExtension
Returns the file extension -
getModifiedDate
Return when the file was last modified, if known. -
getContents
public byte[] getContents()Returns the contents of the attachment.- Throws:
IllegalArgumentException
- if there is no AttachmentData available in this Attachment
-
getRenderedMetaFile
public byte[] getRenderedMetaFile()Returns the Meta File rendered representation of the attachment, or null if not set.
-