Package org.apache.poi.hmef
Class Attachment
- java.lang.Object
-
- org.apache.poi.hmef.Attachment
-
public final class Attachment extends Object
An attachment within aHMEFMessage
. 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 Constructor Description Attachment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TNEFAttribute
getAttribute(TNEFProperty id)
Return the attachment attribute with the given ID, or null if there isn't one.List<TNEFAttribute>
getAttributes()
Returns all HMEF/TNEF attributes of the attachment, such as filename, icon and contentsbyte[]
getContents()
Returns the contents of the attachment.String
getExtension()
Returns the file extensionString
getFilename()
Returns the short filenameString
getLongFilename()
Returns the long filenameMAPIAttribute
getMAPIAttribute(MAPIProperty id)
Return the attachment MAPI Attribute with the given ID, or null if there isn't one.List<MAPIAttribute>
getMAPIAttributes()
Returns all MAPI attributes of the attachment, such as extension, encoding, size and positionDate
getModifiedDate()
Return when the file was last modified, if known.byte[]
getRenderedMetaFile()
Returns the Meta File rendered representation of the attachment, or null if not set.
-
-
-
Method Detail
-
getAttribute
public TNEFAttribute getAttribute(TNEFProperty id)
Return the attachment attribute with the given ID, or null if there isn't one.
-
getMAPIAttribute
public MAPIAttribute getMAPIAttribute(MAPIProperty id)
Return the attachment MAPI Attribute with the given ID, or null if there isn't one.
-
getAttributes
public List<TNEFAttribute> getAttributes()
Returns all HMEF/TNEF attributes of the attachment, such as filename, icon and contents
-
getMAPIAttributes
public List<MAPIAttribute> getMAPIAttributes()
Returns all MAPI attributes of the attachment, such as extension, encoding, size and position
-
getFilename
public String getFilename()
Returns the short filename
-
getLongFilename
public String getLongFilename()
Returns the long filename
-
getExtension
public String getExtension()
Returns the file extension
-
getModifiedDate
public Date 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.
-
-