MapiAttachment

Inheritance: java.lang.Object, com.aspose.email.MapiPropertyContainer

public class MapiAttachment extends MapiPropertyContainer

Represents the attachment in the E-mail message.

Methods

Method Description
getItemId() The item id, uses with a server
getExtension() Gets a filename extension that indicates the document type of an attachment.
getPropertyStream() Gets the property stream.
getSubStorages() Gets the sub storages.
getFileName() Gets an attachment’s base filename and extension, excluding path.
getLongFileName() Gets an attachment’s long filename and extension, excluding path.
getDisplayName() Gets the display name of the ole object in an attachment.
getMimeTag() Gets formatting information about a Multipurpose Internet Mail Extensions (MIME) attachment.
getBinaryData() Gets or sets binary attachment data.
setBinaryData(byte[] value) Gets or sets binary attachment data.
getContent() Gets the content.
getObjectData() Gets an attachment object typically accessed through the OLE IStorage interface.
getNamedProperties() Gets the named properties of message.
save(String filename) Save attachment content.
save(OutputStream stream) Save attachment content.
setProperty(MapiProperty value) Sets the property.
removeProperty(long tag) Provides correctly removing property from all collections.
createMapiNode(String key) Creates the mapi node.
getProperty(PropertyDescriptor pd) Gets MAPI property by property descriptor.
setProperty(PropertyDescriptor pd, Object value) Sets MAPI property.

getItemId()

public String getItemId()

The item id, uses with a server

Returns: java.lang.String

getExtension()

public final String getExtension()

Gets a filename extension that indicates the document type of an attachment.

Value: The extension.

Returns: java.lang.String

getPropertyStream()

public final MapiPropertyStream getPropertyStream()

Gets the property stream.

Value: The property stream.

Returns: MapiPropertyStream

getSubStorages()

public final MapiPropertyCollection getSubStorages()

Gets the sub storages.

Value: The sub storages.

Returns: MapiPropertyCollection

getFileName()

public final String getFileName()

Gets an attachment’s base filename and extension, excluding path.

Value: The file name.

Returns: java.lang.String

getLongFileName()

public final String getLongFileName()

Gets an attachment’s long filename and extension, excluding path.

Value: The long file name.

Returns: java.lang.String

getDisplayName()

public final String getDisplayName()

Gets the display name of the ole object in an attachment.

Value: The display name.

Returns: java.lang.String

getMimeTag()

public final String getMimeTag()

Gets formatting information about a Multipurpose Internet Mail Extensions (MIME) attachment.

Value: The mime tag.

Returns: java.lang.String

getBinaryData()

public final byte[] getBinaryData()

Gets or sets binary attachment data.

Value: The binary data.

Returns: byte[]

setBinaryData(byte[] value)

public final void setBinaryData(byte[] value)

Gets or sets binary attachment data.

Value: The binary data.

Parameters:

Parameter Type Description
value byte[]

getContent()

public final Object getContent()

Gets the content.

Value: The content.

Returns: java.lang.Object

getObjectData()

public final MapiObjectProperty getObjectData()

Gets an attachment object typically accessed through the OLE IStorage interface.

Value: The object data.

Returns: MapiObjectProperty

getNamedProperties()

public final MapiPropertyCollection getNamedProperties()

Gets the named properties of message.

Value: The collection of named properties.

Returns: MapiPropertyCollection

save(String filename)

public final void save(String filename)

Save attachment content.

Parameters:

Parameter Type Description
filename java.lang.String The file name to save.

save(OutputStream stream)

public final void save(OutputStream stream)

Save attachment content.

Parameters:

Parameter Type Description
stream java.io.OutputStream The stream to save.

setProperty(MapiProperty value)

public void setProperty(MapiProperty value)

Sets the property.

Parameters:

Parameter Type Description
value MapiProperty The property.

removeProperty(long tag)

public final void removeProperty(long tag)

Provides correctly removing property from all collections.

Parameters:

Parameter Type Description
tag long The tag of MapiProperty.

createMapiNode(String key)

public IMapiNode createMapiNode(String key)

Creates the mapi node.

Parameters:

Parameter Type Description
key java.lang.String The node key.

Returns: com.aspose.email.IMapiNode - The IMapiNode interface.

getProperty(PropertyDescriptor pd)

public MapiProperty getProperty(PropertyDescriptor pd)

Gets MAPI property by property descriptor.

Parameters:

Parameter Type Description
pd PropertyDescriptor Property descriptor for looked property

Returns: MapiProperty - Mapi property if it is found, otherwise null.

setProperty(PropertyDescriptor pd, Object value)

public void setProperty(PropertyDescriptor pd, Object value)

Sets MAPI property.

Parameters:

Parameter Type Description
pd PropertyDescriptor The property descriptor.
value java.lang.Object The property data.