com.aspose.network.outlook
Class MapiMessage

java.lang.Object
  extended by com.aspose.network.outlook.MapiPropertyContainer
      extended by com.aspose.network.outlook.AbstractMessage
          extended by com.aspose.network.outlook.MapiMessage
All Implemented Interfaces:
IMapiMessageItem

public class MapiMessage
extends AbstractMessage
implements IMapiMessageItem

Represents an Outlook Message format document that can be parsed.


Constructor Summary
MapiMessage()
          Create an instance of MapiMessage.
MapiMessage(boolean unicode)
          Create an instance of MapiMessage.
MapiMessage(MapiPropertyCollection propertyCollection, MapiAttachmentCollection attachmentCollection, MapiRecipientCollection recipientCollection)
          Create an instance of MapiMessage using MapiPropertyCollection, MapiAttachmentCollection and MapiRecipientCollection.
 
Method Summary
static MapiMessage fromFile(String path)
          Returns a MapiMessage instance which is loaded from the specified file.
static MapiMessage fromProperties(MapiPropertyCollection properties)
          Creates an instance of MapiMessage from a collection of Mapi properties.
static MapiMessage fromStream(InputStream stream)
          Returns a MapiMessage instance which is loaded from the specified file.
 MapiNamedPropertyMappingStorage getNamedPropertyMapping()
          Gets the named property mapping.
 void save(OutputStream stream)
           
 void save(String fileName)
          Save message to specified file name.
static MapiEmbeddedMessage toEmbeddedMessage(MapiMessage message)
          Converts MapiMessage to MapiEmbeddedMessage
 IMapiMessageItem toMapiMessageItem()
          Convert MapiMessage to IMapiMessageItem object in dependence with MessageClass Note, that the following message classes are supported by now: IPM.Note, IPM.StickyNote, IPM.Contact.
 
Methods inherited from class com.aspose.network.outlook.AbstractMessage
getAttachments, getBody, getBodyRtf, getClientSubmitTime, getConversationTopic, getDisplayBcc, getDisplayCc, getDisplayName, getDisplayNamePrefix, getDisplayTo, getInternetMessageId, getInternetMessageId, getMessageClass, getNormalizedSubject, getProperties, getRecipients, getSenderAddressType, getSenderEmailAddress, getSenderName, getSentRepresentingAddressType, getSentRepresentingEmailAddress, getSentRepresentingName, getSubject, getSubjectPrefix, getTransportMessageHeaders, isStoreUnicodeOk, setBody, setClientSubmitTime, setCodePage, setConversationTopic, setDisplayBcc, setDisplayCc, setDisplayName, setDisplayNamePrefix, setDisplayTo, setMessageClass, setNormalizedSubject, setSenderAddressType, setSenderEmailAddress, setSenderName, setSentRepresentingAddressType, setSentRepresentingEmailAddress, setSentRepresentingName, setSubject, setSubjectPrefix, setTransportMessageHeaders
 
Methods inherited from class com.aspose.network.outlook.MapiPropertyContainer
getCodePage, getProperty, getPropertyBinary, getPropertyBooolean, getPropertyByte, getPropertyDateTime, getPropertyDouble, getPropertyFloat, getPropertyInt, getPropertyLong, getPropertyShort, getPropertyString, getPropertyString, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aspose.network.outlook.IMapiMessageItem
getBody, getMessageClass, getSubject
 

Constructor Detail

MapiMessage

public MapiMessage(MapiPropertyCollection propertyCollection,
                   MapiAttachmentCollection attachmentCollection,
                   MapiRecipientCollection recipientCollection)
Create an instance of MapiMessage using MapiPropertyCollection, MapiAttachmentCollection and MapiRecipientCollection.

Parameters:
propertyCollection - messsage properties
attachmentCollection - messsage attachments
recipientCollection - messsage recipients

MapiMessage

public MapiMessage()
Create an instance of MapiMessage.


MapiMessage

public MapiMessage(boolean unicode)
Create an instance of MapiMessage.

Parameters:
unicode - determine if message will support unicode or ascii
Method Detail

fromFile

public static MapiMessage fromFile(String path)
                            throws Exception
Returns a MapiMessage instance which is loaded from the specified file.

Parameters:
path - path to file to load message from
Returns:
MapiMessage instance which is loaded from the specified file
Throws:
Exception - when message cannot be loaded

fromStream

public static MapiMessage fromStream(InputStream stream)
                              throws Exception
Returns a MapiMessage instance which is loaded from the specified file.

Parameters:
stream - stream to load message from
Returns:
MapiMessage instance which is loaded from the specified file
Throws:
Exception - when message cannot be loaded

save

public void save(String fileName)
          throws Exception
Save message to specified file name.

Parameters:
fileName - file to save message
Throws:
Exception - when fail to save

save

public void save(OutputStream stream)
          throws Exception
Throws:
Exception

getNamedPropertyMapping

public MapiNamedPropertyMappingStorage getNamedPropertyMapping()
Gets the named property mapping.

Returns:
named property mapping

toEmbeddedMessage

public static MapiEmbeddedMessage toEmbeddedMessage(MapiMessage message)
Converts MapiMessage to MapiEmbeddedMessage

Parameters:
message - mapi message to convert
Returns:
embedded message

fromProperties

public static MapiMessage fromProperties(MapiPropertyCollection properties)
                                  throws Exception
Creates an instance of MapiMessage from a collection of Mapi properties.

Parameters:
properties - A collection of MapiProperty
Returns:
Returns a MapiMessage instance which is loaded from the specified properties
Throws:
Exception

toMapiMessageItem

public IMapiMessageItem toMapiMessageItem()
                                   throws Exception
Convert MapiMessage to IMapiMessageItem object in dependence with MessageClass Note, that the following message classes are supported by now: IPM.Note, IPM.StickyNote, IPM.Contact. If MapiMessage has another class, different from these ones, then NotSupportedException is thrown. If MessageClass is IPM.Note, then MapiMessage copy is returned.

Returns:
an IMapiMessageItem
Throws:
UnsupportedOperationException - Thrown when MessageClass doesn't belong to IPM.Note, IPM.StickyNote, IPM.Contact
Exception


Copyright © 2011 Aspose. All Rights Reserved.