com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class MapiAttachmentCollection

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.aspose.ms.System.Collections.Generic.List

        com.aspose.ms.System.Collections.Generic.List.Enumerator<T>
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(String name, byte[] data)
      Adds the new attachment.
      void add(String name, MapiMessage msg)
      Adds the new attachment as embedded message.
      void addMapiAttachment(MapiAttachment item)
      Adds an object to the end of the System.Collections.ObjectModel.Collection`1.
      void insert(int index, String name, MapiMessage msg)
      Inserts a message as attachment into the MapiAttachmentCollection at the specified index.
      void insertMapiAttachment(int index, MapiAttachment item)
      Inserts an element into the System.Collections.ObjectModel.Collection`1 at the specified index.
      void removeAt(int index)
      Removes the element at the specified index of the MapiAttachmentCollection.
      boolean removeMapiAttachment(MapiAttachment item)
      Removes the first occurrence of a specific object from the MapiAttachmentCollection.
      void replace(int index, String name, MapiMessage msg)
      Replaces an element at the specified index.
      • Methods inherited from class com.aspose.ms.System.Collections.Generic.List

        add, add, addAll, addAll, addItem, addRange, addRange, asReadOnly, binarySearch, binarySearch, binarySearch, clear, contains, containsAll, containsItem, convertAll, copyTo, copyTo, copyTo, copyToTArray, exists, find, findAll, findIndex, findIndex, findIndex, findLast, findLastIndex, findLastIndex, findLastIndex, forEach, fromJava, get_Item, get, getCapacity, getRange, getSyncRoot, getVersion, indexOf, indexOf, indexOf, indexOfItem, insertItem, insertRange, isEmpty, isFixedSize, isReadOnly, isSynchronized, iterator, lastIndexOf, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAll, removeItem, removeRange, retainAll, reverse, reverse, set_Item, set, setCapacity, size, sort, sort, sort, sort, subList, toArray, toArray, toJava, trimExcess, trueForAll
    • Constructor Detail

      • MapiAttachmentCollection

        public MapiAttachmentCollection()

        Initializes a new instance of the MapiAttachmentCollection class.

      • MapiAttachmentCollection

        public MapiAttachmentCollection(MapiMessageItemBase owner)

        Initializes a new instance of the MapiAttachmentCollection class.

        Parameters:
        owner - The owner message.
    • Method Detail

      • add

        public final void add(String name,
               MapiMessage msg)

        Adds the new attachment as embedded message.

        Parameters:
        name - The name of attachment.
        msg - The MapiMessage that represents the attached message.
        Throws:
        com.aspose.ms.System.ArgumentNullException - throws if message is null.
      • add

        public final void add(String name,
               byte[] data)

        Adds the new attachment.

        Parameters:
        name - The name of attachment.
        data - The attachment data.
        Throws:
        com.aspose.ms.System.ArgumentNullException - throws if attachment name is null or empty.
        com.aspose.ms.System.ArgumentNullException - throws if attachment data is null.
      • addMapiAttachment

        public final void addMapiAttachment(MapiAttachment item)

        Adds an object to the end of the System.Collections.ObjectModel.Collection`1.

        Parameters:
        item - The object to be added to the end of the System.Collections.ObjectModel.Collection`1. The value can be null for reference types.
      • insertMapiAttachment

        public final void insertMapiAttachment(int index,
                                MapiAttachment item)

        Inserts an element into the System.Collections.ObjectModel.Collection`1 at the specified index.

        Parameters:
        index - The zero-based index at which item should be inserted.
        item - The object to insert. The value can be null for reference types.
        Throws:
        ArgumentOutOfRangeException - index is less than zero.

        -or-

        index is greater than P:System.Collections.ObjectModel.Collection`1.Count.
      • insert

        public final void insert(int index,
                  String name,
                  MapiMessage msg)

        Inserts a message as attachment into the MapiAttachmentCollection at the specified index.

        Parameters:
        index - The zero-based index at which should be inserted.
        name - The name of attachment.
        msg - The MapiMessage that represents the attached message.
        Throws:
        com.aspose.ms.System.ArgumentNullException - throws if message is null.
      • replace

        public final void replace(int index,
                   String name,
                   MapiMessage msg)

        Replaces an element at the specified index.

        Parameters:
        index - The zero-based index at which should be replaced.
        name - The name of attachment.
        msg - The MapiMessage that represents the attached message.
        Throws:
        com.aspose.ms.System.ArgumentNullException - throws if message is null.
      • removeAt

        public final void removeAt(int index)

        Removes the element at the specified index of the MapiAttachmentCollection.

        Specified by:
        removeAt in interface com.aspose.ms.System.Collections.Generic.IGenericList<MapiAttachment>
        Overrides:
        removeAt in class com.aspose.ms.System.Collections.Generic.List<MapiAttachment>
        Parameters:
        index - he zero-based index of the element to remove.
      • removeMapiAttachment

        public final boolean removeMapiAttachment(MapiAttachment item)

        Removes the first occurrence of a specific object from the MapiAttachmentCollection.

        Parameters:
        item - The object to remove from the MapiAttachmentCollection.
        Returns:
        true if item is successfully removed; otherwise, false.