com.moyosoft.exchange.attachment
Interface ExchangeItemAttachment

All Superinterfaces:
ExchangeAttachment

public interface ExchangeItemAttachment
extends ExchangeAttachment

Represents an Exchange item attached to another Exchange item.


Method Summary
 ExchangeItem getItem()
          Returns the attached item.
 void writeTo(java.io.File file)
          Writes the content of the attached item to the specified file in RFC-822 format (EML format) if the attached item is a message.
 void writeTo(java.io.OutputStream stream)
          Writes the content of the attached item to the specified output stream in RFC-822 format (EML format) if the attached item is a message.
 
Methods inherited from interface com.moyosoft.exchange.attachment.ExchangeAttachment
delete, getAttachmentInfo, getContentId, getContentLocation, getContentType, getName, getParentItemId
 

Method Detail

getItem

ExchangeItem getItem()
                     throws ExchangeServiceException
Returns the attached item.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

writeTo

void writeTo(java.io.OutputStream stream)
             throws ExchangeServiceException,
                    java.io.IOException
Writes the content of the attached item to the specified output stream in RFC-822 format (EML format) if the attached item is a message.

Specified by:
writeTo in interface ExchangeAttachment
Parameters:
stream - the stream to write into.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
java.io.IOException - if errors occur when writing to the specified stream.

writeTo

void writeTo(java.io.File file)
             throws ExchangeServiceException,
                    java.io.IOException
Writes the content of the attached item to the specified file in RFC-822 format (EML format) if the attached item is a message. If the specified file doesn't exist, it will be created.

Specified by:
writeTo in interface ExchangeAttachment
Parameters:
file - the file to write into.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
java.io.IOException - if errors occur when writing to the specified file.