public final class Attachment
extends java.lang.Object
HMEFMessage
. Provides both helper methods to get at common parts and attributes of the attachment, and list methods to get all of them.
(HMEFMessage 中的附件。提供帮助方法来获取附件的公共部分和属性,并列出获取所有这些的方法。)
Constructor and Description |
---|
Attachment() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAttribute(TNEFAttribute attr) |
TNEFAttribute |
getAttribute(TNEFProperty id)
Return the attachment attribute with the given ID, or null if there isn't one.
(返回具有给定 ID 的附件属性,如果没有,则返回 null。)
|
java.util.List<TNEFAttribute> |
getAttributes()
Returns all HMEF/TNEF attributes of the attachment, such as filename, icon and contents
(返回附件的所有 HMEF/TNEF 属性,例如文件名、图标和内容)
|
byte[] |
getContents()
Returns the contents of the attachment.
(返回附件的内容。)
|
java.lang.String |
getExtension()
Returns the file extension
(返回文件扩展名)
|
java.lang.String |
getFilename()
Returns the short filename
(返回短文件名)
|
java.lang.String |
getLongFilename()
Returns the long filename
(返回长文件名)
|
MAPIAttribute |
getMAPIAttribute(MAPIProperty id)
Return the attachment MAPI Attribute with the given ID, or null if there isn't one.
(返回具有给定 ID 的附件 MAPI 属性,如果没有,则返回 null。)
|
java.util.List<MAPIAttribute> |
getMAPIAttributes()
Returns all MAPI attributes of the attachment, such as extension, encoding, size and position
(返回附件的所有 MAPI 属性,例如扩展名、编码、大小和位置)
|
java.util.Date |
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.
(返回附件的元文件呈现表示,如果未设置,则返回 null。)
|
protected void addAttribute(TNEFAttribute attr)
public TNEFAttribute getAttribute(TNEFProperty id)
public MAPIAttribute getMAPIAttribute(MAPIProperty id)
public java.util.List<TNEFAttribute> getAttributes()
public java.util.List<MAPIAttribute> getMAPIAttributes()
public java.lang.String getFilename()
public java.lang.String getLongFilename()
public java.lang.String getExtension()
public java.util.Date getModifiedDate()
public byte[] getContents()
java.lang.IllegalArgumentException
- if there is no AttachmentData available in this Attachment
(java.lang.IllegalArgumentException - 如果此 Attachment 中没有可用的 AttachmentData)
public byte[] getRenderedMetaFile()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.