org.opencrx.application.uses.net.freeutils.tnef
Class Attachment

java.lang.Object
  extended by org.opencrx.application.uses.net.freeutils.tnef.Attachment

public class Attachment
extends Object

The Attachment class encapsulates a TNEF message attachment.

Since:
2003-04-25
Author:
Amichai Rothman

Constructor Summary
Attachment()
          Constructs an empty Attachment.
 
Method Summary
 void addAttribute(Attr attr)
          Adds an Attachment attribute.
 Attr getAttribute(int ID)
          Gets a specific Attachment attribute.
 List getAttributes()
          Gets the Attachment attributes.
 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(List attributes)
          Sets the Attachment attributes.
 void setFilename(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.
 String toString()
          Returns a string representation of this object.
 void writeTo(OutputStream out)
          Writes the content of this attachment to a stream.
 void writeTo(String filename)
          Writes the content of this attachment to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment()
Constructs an empty Attachment.

Method Detail

getAttributes

public List getAttributes()
Gets the Attachment attributes.

Returns:
the Attachment attributes

setAttributes

public void setAttributes(List attributes)
Sets the Attachment attributes.

Parameters:
attributes - the Attachment attributes

getAttribute

public Attr getAttribute(int ID)
Gets a specific Attachment attribute.

Parameters:
ID - the requested attribute ID
Returns:
the requested Attachment attribute, or null if no such attribute exists

getFilename

public String getFilename()
Gets the Attachment filename.

Returns:
the Attachment filename, or null if none exists

setFilename

public void setFilename(String filename)
Sets the Attachment filename.

Parameters:
filename - the Attachment filename

addAttribute

public void addAttribute(Attr attr)
Adds an Attachment attribute.

Parameters:
attr - the Attachment attribute to add

getRawData

public RawInputStream getRawData()
Gets the Attachment raw data.

Returns:
the Attachment raw data

setRawData

public void setRawData(RawInputStream rawData)
Sets the Attachment raw data.

Parameters:
rawData - the Attachment raw data

getNestedMessage

public Message getNestedMessage()
Gets the Attachment nested message.

Returns:
the Attachment nested message

setNestedMessage

public void setNestedMessage(Message nestedMessage)
Sets the Attachment nested message.

Parameters:
nestedMessage - the Attachment nested message

getMAPIProps

public MAPIProps getMAPIProps()
Gets the Attachment MAPI properties.

Returns:
the Attachment MAPI properties

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a string representation of this object

setMAPIProps

public void setMAPIProps(MAPIProps MAPIProps)
                  throws IOException
Sets this Attachment's MAPI properties. Special properties will be translated into the Attachment's fields.

Parameters:
MAPIProps - a collection of properties to set
Throws:
IOException - if an I/O error occurs

writeTo

public void writeTo(String filename)
             throws IOException
Writes the content of this attachment to a file.

Parameters:
filename - the fully qualified filename to which the attachment content should be written
Throws:
IOException - if an I/O error occurs

writeTo

public void writeTo(OutputStream out)
             throws IOException
Writes the content of this attachment to a stream.

Parameters:
out - the OutputStream to which the attachment content should be written
Throws:
IOException - if an I/O error occurs


This software is published under the BSD license. Copyright © 2003-2013, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.