com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class FolderInfo



  • public final class FolderInfo
    extends Object

    Represents information about personal folder in PST.

    • Field Detail

      • MessageAdded

        public final com.aspose.ms.lang.Event<MessageAddedEventHandler> MessageAdded

        Occurs when a message is added to the current folder.

      • ItemMoved

        public final com.aspose.ms.lang.Event<ItemMovedEventHandler> ItemMoved

        Occurs when an item is moved to the another folder.

    • Constructor Detail

      • FolderInfo

        public FolderInfo()

        Initializes a new instance of the FolderInfo class.

    • Method Detail

      • getDisplayName

        public String getDisplayName()

        Gets the display name of folder.

        Value: The display name.
      • getContentCount

        public int getContentCount()

        Gets the total number of items in the folder.

        Value: The content count.
      • getContentUnreadCount

        public int getContentUnreadCount()

        Gets the number of unread items in the folder.

        Value: The content unread count.
      • hasSubFolders

        public boolean hasSubFolders()

        Gets a value indicating whether the Folder object has any subfolders.

        Value: The has sub folders.
      • getContainerClass

        public String getContainerClass()

        Gets container class of the folder object.

        Value: The container class.
      • getLastModificationTime

        public Date getLastModificationTime()

        Gets the last modification time.

        Value: The last modification time. If the folder doesn't have PR_LAST_MODIFICATION_TIME property, DateTime.MinValue is returned.
        Returns:
        a java$util$Date object.
      • getEntryId

        public byte[] getEntryId()

        Gets the entry ID.

        Value: The entry id.
      • getEntryIdString

        public String getEntryIdString()

        Gets string representation of entry ID.

        Value: The entry id string.
      • getSubFolder

        public FolderInfo getSubFolder(String name)

        Get subfolder.

        Parameters:
        name - Name of subfolder.
        Returns:
        A FolderInfo object.
      • getSubFolder

        public FolderInfo getSubFolder(String name,
                              boolean ignoreCase)

        Gets the subfolder.

        Parameters:
        name - Name of subfolder.
        ignoreCase - Indicates that a search should ignore case sensitivity when matching the folder name.
        Returns:
        A FolderInfo object.
      • getSubFolders

        public FolderInfoCollection getSubFolders()

        Gets collection of subfolders.

        Returns:
        The FolderInfo collection.
      • getSubFolders

        public FolderInfoCollection getSubFolders(int kind)

        Gets collection of subfolders.

        Parameters:
        kind - The FolderKind that represents kind of folder.
        Returns:
        The FolderInfo collection.
      • getSubFolders

        public FolderInfoCollection getSubFolders(MailQuery query)

        Gets collection of subfolders.

        Parameters:
        query - MailQuery that represents search query.
        Returns:
        The FolderInfo collection.
      • getContents

        public MessageInfoCollection getContents(boolean tryToReadCorruptedContents)

        Get collection of messages.

        Parameters:
        tryToReadCorruptedContents - If the value of this parameter is true, the method will try to read the content even if the file is corrupted. This value can be used if the GetContents() method throws an exception about the file corruption. If the value of this parameter is false, the method works in the same way as GetContents() method without parameters.
        Returns:
        Collection of MessageInfo.
      • getContents

        public MessageInfoCollection getContents()

        Get collection of messages.

        Returns:
        Collection of MessageInfo.
      • getContents

        public MessageInfoCollection getContents(int kind)

        Get collection of messages.

        Parameters:
        kind - The message kind.
        Returns:
        Collection of MessageInfo.
      • getContents

        public MessageInfoCollection getContents(MailQuery query)

        Get collection of messages.

        Parameters:
        query - MailQuery that represents search query.
        Returns:
        Collection of MessageInfo.
      • getContents

        public MessageInfoCollection getContents(int startIndex,
                                        int count)

        Gets the collection of messages.

        Parameters:
        startIndex - The start message index.
        count - The number of messages that will be retrieved.


        If "count" param is less than 0 or more than remained message count then remained message count will be returned.

        Returns:
        Collection of MessageInfo.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - throws, if startIndex less than 0.
        com.aspose.ms.System.ArgumentOutOfRangeException - throws, if startIndex more or equal to total message count that folder contains.
      • enumerateFolders

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders()

        Exposes the enumerator, which supports an iteration of subfolders in folder.

        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through a subfolders in folder.
      • enumerateFolders

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders(int kind)

        Exposes the enumerator, which supports an iteration of subfolders in folder.

        Parameters:
        kind - The FolderKind that represents kind of folder.
        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through a subfolders in folder.
      • enumerateMessages

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageInfo> enumerateMessages()

        Exposes the enumerator, which supports an iteration of messages in folder.

        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through a messages in folder.
      • enumerateMessageObjects

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageObject> enumerateMessageObjects()

        Exposes the enumerator, which supports an iteration of messages in folder.

        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through a messages in folder.
      • enumerateMapiMessages

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MapiMessage> enumerateMapiMessages()

        Exposes the enumerator, which supports an iteration of messages in folder.

        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through a messages in folder.
      • enumerateMessagesEntryId

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<String> enumerateMessagesEntryId()

        Enumerates the entryID of messages.

        Returns:
        System.Collections.Generic.IEnumerableltTgt, that represents an enumerator that iterates through entryID of messages in folder.
      • retrieveFullPath

        public String retrieveFullPath()

        Retrieves the full path of folder within the PST file.

        Returns:
        The string that represents the full path.
      • addSubFolder

        public FolderInfo addSubFolder(String name)

        Adds the new subfolder.

        Parameters:
        name - The name of subfolder.
        Returns:
        The new subfolder.
        Throws:
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.ms.System.ArgumentNullException - throws, if a subfolder name is null or empty.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
      • addSubFolder

        public FolderInfo addSubFolder(String name,
                              String containerClass)

        Adds the new subfolder.

        Parameters:
        name - The name of subfolder.
        containerClass - Container class of the sub-Folder object.
        Returns:
        The new subfolder.
        Throws:
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.ms.System.ArgumentNullException - throws, if a subfolder name is null or empty.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
      • addMessage

        public String addMessage(MapiMessage message)

        Adds a new message into folder.

        Parameters:
        message - The message necessary to add.
        Returns:
        The string that represents the EntryId of the added message.
        Throws:
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.ms.System.ArgumentNullException - throws, if a message to add is null.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
      • addFile

        public String addFile(String fileName,
                     String messageClass)

        Adds a file into pst folder.

        Parameters:
        fileName - The name of file necessary to add.
        messageClass - The message class.
        Returns:
        The string that represents the EntryId of the added message.
        Throws:
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.ms.System.ArgumentNullException - throws, if a name of file to add is null or empty.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
      • addMapiMessageItem

        public String addMapiMessageItem(IMapiMessageItem item)

        Adds the IMapiMessageItem object into folder.

        Parameters:
        item - The item necessary to add.
        Returns:
        The string that represents the EntryId of the added item.
        Throws:
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.ms.System.ArgumentNullException - throws, if an item to add is null.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
        com.aspose.ms.System.NotSupportedException - Thrown when MessageClass doesn't belong to IPM.Note, IPM.StickyNote, IPM.Contact, IPM.Activity, IPM.Appointment, IPM.Schedule.meeting, IPM.Task.
        com.aspose.ms.System.InvalidOperationException - Thrown when MessageClass doesn't correspond to the folder's ContainerClass.
      • addMessages

        public void addMessages(Iterable<MapiMessage> messages)

        Provides message adding in a bulk mode.

        Parameters:
        messages - An T:System.Collections.IEnumerator representing the enumerator, which supports iteration over a collection of MapiMessage.
      • moveContents

        public void moveContents(FolderInfo newFolder)

        Moves the contents to a new folder.

        Parameters:
        newFolder - The new folder.
      • moveSubfolders

        public void moveSubfolders(FolderInfo newFolder)

        Moves the subfolders to a new parent folder.

        Parameters:
        newFolder - The new parent folder.
      • mergeWith

        public void mergeWith(FolderInfo sourceFolder)

        Merges the folder with the folder from another pst.

        Parameters:
        sourceFolder - The source folder.
        Throws:
        com.aspose.ms.System.InvalidOperationException - Throws when the source folder is located in the same pst.
      • deleteChildItem

        public void deleteChildItem(byte[] entryId)

        Deletes the item (folder or message) by it's entryId.

        Parameters:
        entryId - The entry id.


        The item must be contained in a folder.

        Throws:
        com.aspose.ms.System.ArgumentNullException - throws, if entryId is null.
        com.aspose.ms.System.InvalidOperationException - throws, if the item doesn't belong to the folder or the item can't be deleted or entryID has the incorrect value.
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
      • deleteChildItems

        public void deleteChildItems(Iterable<String> entryIdCollection)

        Deletes the child messages.

        Parameters:
        entryIdCollection - The entry id collection.
        Throws:
        com.aspose.ms.System.NotImplementedException - The ANSI file version editing is not implemented.
        com.aspose.ms.System.InvalidOperationException - The PST is open for reading only. or The item, to be deleted, doesn't belong to this folder. or The search folder cannot be deleted. or The \Deleted Items\ folder cannot be deleted. or The entryId is incorrect.
        com.aspose.ms.System.ArgumentNullException - entryId;The entryId cannot be null.
      • changeMessages

        public void changeMessages(Iterable<String> entryIdCollection,
                          MapiPropertyCollection updatedProperties)

        Changes the messages in folder.

        Parameters:
        entryIdCollection - The entry identifier collection.
        updatedProperties - The updated properties.
        Throws:
        com.aspose.ms.System.NotImplementedException - The ANSI file version editing is not implemented.
        com.aspose.ms.System.InvalidOperationException - The PST is open for reading only. or The entryId is incorrect.
        com.aspose.ms.System.ArgumentNullException - entryIdCollection;The collection of entry ids cannot be null. or updatedProperties;The collection of properties cannot be null.
      • changeMessages

        public void changeMessages(MapiPropertyCollection updatedProperties)

        Changes all messages in folder.

        Parameters:
        updatedProperties - The updated properties.
        Throws:
        com.aspose.ms.System.NotImplementedException - The ANSI file version editing is not implemented.
        com.aspose.ms.System.InvalidOperationException - The PST is open for reading only. or The entryId is incorrect.
        com.aspose.ms.System.ArgumentNullException - entryIdCollection;The collection of entry ids cannot be null. or updatedProperties;The collection of properties cannot be null.
      • changeContainerClass

        public void changeContainerClass(String containerClass)

        Changes the container class.

        Parameters:
        containerClass - Container class of the of the folder object.
        Throws:
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
      • changeDisplayName

        public void changeDisplayName(String newName)

        Changes the display name.

        Parameters:
        newName - A new name.
        Throws:
        com.aspose.ms.System.InvalidOperationException - throws, if a PST is open for reading only.
        com.aspose.ms.System.NotImplementedException - throws, if a PST file version is ANSI.