public class Attachment
extends java.lang.Object
Attachment class encapsulates a TNEF message attachment.| Constructor and Description | 
|---|
Attachment()
Constructs an empty Attachment. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addAttribute(Attr attr)
Adds an Attachment attribute. 
 | 
Attr | 
getAttribute(int ID)
Gets a specific Attachment attribute. 
 | 
java.util.List<Attr> | 
getAttributes()
Gets the Attachment attributes. 
 | 
java.lang.String | 
getFilename()
Gets the Attachment filename. 
 | 
MAPIProps | 
getMAPIProps()
Gets the Attachment MAPI properties. 
 | 
Message | 
getNestedMessage()
Gets the Attachment nested message. 
 | 
RawInputStream | 
getRawData()
Gets the Attachment raw data. 
 | 
void | 
setAttributes(java.util.List<Attr> attributes)
Sets the Attachment attributes. 
 | 
void | 
setFilename(java.lang.String filename)
Sets the Attachment filename. 
 | 
void | 
setMAPIProps(MAPIProps MAPIProps)
Sets this Attachment's MAPI properties. 
 | 
void | 
setNestedMessage(Message nestedMessage)
Sets the Attachment nested message. 
 | 
void | 
setRawData(RawInputStream rawData)
Sets the Attachment raw data. 
 | 
java.lang.String | 
toString()
Returns a string representation of this object. 
 | 
void | 
writeTo(java.io.OutputStream out)
Writes the content of this attachment to a stream. 
 | 
void | 
writeTo(java.lang.String filename)
Writes the content of this attachment to a file. 
 | 
public java.util.List<Attr> getAttributes()
public void setAttributes(java.util.List<Attr> attributes)
attributes - the Attachment attributespublic Attr getAttribute(int ID)
ID - the requested attribute IDpublic java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename - the Attachment filenamepublic void addAttribute(Attr attr)
attr - the Attachment attribute to addpublic RawInputStream getRawData()
public void setRawData(RawInputStream rawData)
rawData - the Attachment raw datapublic Message getNestedMessage()
public void setNestedMessage(Message nestedMessage)
nestedMessage - the Attachment nested messagepublic MAPIProps getMAPIProps()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setMAPIProps(MAPIProps MAPIProps) throws java.io.IOException
MAPIProps - a collection of properties to setjava.io.IOException - if an I/O error occurspublic void writeTo(java.lang.String filename)
             throws java.io.IOException
filename - the fully qualified filename to which the attachment content
            should be writtenjava.io.IOException - if an I/O error occurspublic void writeTo(java.io.OutputStream out)
             throws java.io.IOException
out - the OutputStream to which the attachment content should be
            writtenjava.io.IOException - if an I/O error occursCopyright © 2023. All Rights Reserved.