com.aspose.email

com.aspose.email

Class FolderInfo

public final class FolderInfo
extends Object

Represents information about personal folder in PST.

Constructor Summary
FolderInfo()
Initializes a new instance of the FolderInfo class.
 
Method Summary
addMapiMessageItem(IMapiMessageItem item)
Adds the IMapiMessageItem object into folder.
addMessage(MapiMessage message)
Adds a new message into folder.
addSubFolder(String name)
Adds the new subfolder.
addSubFolder(String name, String containerClass)
Adds the new subfolder.
void
changeDisplayName(String newName)
Changes the display name.
void
deleteChildItem(byte[]entryId)
Deletes the item (folder or message) by it's entryId.
enumerateFolders()
Exposes the enumerator, which supports an iteration of subfolders in folder.
enumerateMapiMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMessageObjects()
Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMessagesEntryId()
Enumerates the entryID of messages.
getContainerClass()
Gets container class of the folder object.
int
getContentCount()
Gets the total number of items in the folder.
getContents()
Get collection of messages.
getContents(booleantryToReadCorruptedContents)
Get collection of messages.
getContents(intstartIndex, intcount)
Gets the collection of messages.
int
getContentUnreadCount()
Gets the number of unread items in the folder.
getDisplayName()
Gets the display name of folder.
byte[]
getEntryId()
Gets the entry ID.
getEntryIdString()
Gets string representation of entry ID.
getProperties()
Gets the folder properties.
getSubFolder(String name)
Get subfolder.
getSubFolders()
Gets collection of subfolders.
boolean
hasSubFolders()
Gets a value indicating whether the Folder object has any subfolders.
retrieveFullPath()
Retrieves the full path of folder within the PST file.
 
Methods inherited from class java.lang.Object
 

    • 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()
      • 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.

      • getSubFolders

        public FolderInfoCollection getSubFolders()

        Gets collection of subfolders.

        Returns:
        The FolderInfo collection.
      • getSubFolder

        public FolderInfo getSubFolder(String name)

        Get subfolder.

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

        public String retrieveFullPath()

        Retrieves the full path of folder within the PST file.

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

        public MessageInfoCollection getContents()

        Get collection of messages.

        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.email.ms.System.IllegalArgumentException - throws, if startIndex less than 0.
        com.aspose.email.ms.System.IllegalArgumentException - throws, if startIndex more or equal to total message count that folder contains.
      • enumerateFolders

        public Iterable<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.
      • enumerateMessages

        public Iterable<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 Iterable<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 Iterable<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 Iterable<String> enumerateMessagesEntryId()

        Enumerates the entryID of messages.

        Returns:
      • 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.
      • addSubFolder

        public FolderInfo addSubFolder(String name)

        Adds the new subfolder.

        Parameters:
        name - The name of subfolder.
        Returns:
        The new subfolder.
        Throws:
        com.aspose.email.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.email.ms.System.IllegalArgumentException - throws, if a subfolder name is null or empty.
        IllegalStateException - 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.email.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.email.ms.System.IllegalArgumentException - throws, if a subfolder name is null or empty.
        IllegalStateException - 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.email.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.email.ms.System.IllegalArgumentException - throws, if a message to add is null.
        IllegalStateException - 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.email.ms.System.NotImplementedException - throws, if a PST file version is ANSI.
        com.aspose.email.ms.System.IllegalArgumentException - throws, if an item to add is null.
        IllegalStateException - throws, if a PST is open for reading only.
        UnsupportedOperationException - Thrown when MessageClass doesn't belong to IPM.Note, IPM.StickyNote, IPM.Contact, IPM.Activity, IPM.Appointment, IPM.Schedule.meeting, IPM.Task.
        IllegalStateException - Thrown when MessageClass doesn't correspond to the folder's ContainerClass.
      • 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.email.ms.System.IllegalArgumentException - throws, if entryId is null.
        IllegalStateException - throws, if the item doesn't belong to the folder or the item can't be deleted or enrtyID has the incorrect value.
        IllegalStateException - throws, if a PST is open for reading only.
      • changeDisplayName

        public void changeDisplayName(String newName)

        Changes the display name.

        Parameters:
        newName - A new name.
        Throws:
        IllegalStateException - throws, if a PST is open for reading only.