com.moyosoft.exchange.attachment
Interface ExchangeAttachment

All Known Subinterfaces:
ExchangeFileAttachment, ExchangeItemAttachment

public interface ExchangeAttachment

Represents an attachment attached to an Exchange item. An attachment can be a file (ExchangeFileAttachment) or an Exchange item (ExchangeItemAttachment).


Method Summary
 void delete()
          Deletes this attachment.
 AttachmentInfo getAttachmentInfo()
          Returns additional information on the attachment.
 java.lang.String getContentId()
          Returns an application-specific identifier for the contents of an attachment.
 java.lang.String getContentLocation()
          Returns the URI corresponding to the location of the content of the attachment.
 java.lang.String getContentType()
          Returns the MIME type of the attachment content.
 java.lang.String getName()
          Returns the displayed name of the attachment.
 java.lang.String getParentItemId()
          Returns the ID of the parent item that this attachment is attached to.
 void writeTo(java.io.File file)
          Writes the content of the attachment to the specified file.
 void writeTo(java.io.OutputStream stream)
          Writes the content of the attachment to the specified output stream.
 

Method Detail

getParentItemId

java.lang.String getParentItemId()
                                 throws ExchangeServiceException
Returns the ID of the parent item that this attachment is attached to.

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

getAttachmentInfo

AttachmentInfo getAttachmentInfo()
                                 throws ExchangeServiceException
Returns additional information on the attachment.

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

getName

java.lang.String getName()
                         throws ExchangeServiceException
Returns the displayed name of the attachment.

Throws:
ExchangeServiceException

getContentType

java.lang.String getContentType()
                                throws ExchangeServiceException
Returns the MIME type of the attachment content.

Throws:
ExchangeServiceException

getContentId

java.lang.String getContentId()
                              throws ExchangeServiceException
Returns an application-specific identifier for the contents of an attachment.

Throws:
ExchangeServiceException

getContentLocation

java.lang.String getContentLocation()
                                    throws ExchangeServiceException
Returns the URI corresponding to the location of the content of the attachment.

Throws:
ExchangeServiceException

delete

void delete()
            throws ExchangeServiceException
Deletes this attachment. It will therefore be removed from the attachments of the parent 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 attachment to the specified output stream.

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 attachment to the specified file. If the specified file doesn't exist, it will be created.

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.