FolderInfo

Inheritance: java.lang.Object

public final class FolderInfo

Represents information about personal folder in PST.

Constructors

Constructor Description
FolderInfo() Initializes a new instance of the FolderInfo class.

Fields

Field Description
MessageAdded Occurs when a message is added to the current folder.
ItemMoved Occurs when an item is moved to the another folder.

Methods

Method Description
getDisplayName() Gets the display name of folder.
getContentCount() Gets the total number of items in the folder.
getContentUnreadCount() Gets the number of unread items in the folder.
hasSubFolders() Gets a value indicating whether the Folder object has any subfolders.
getContainerClass() Gets container class of the folder object.
getLastModificationTime() Gets the last modification time.
getEntryId() Gets the entry ID.
getEntryIdString() Gets string representation of entry ID.
getProperties() Gets the folder properties.
getSubFolder(String name) Get subfolder.
getSubFolder(String name, boolean ignoreCase) Gets the subfolder.
getSubFolders() Gets collection of subfolders.
getSubFolders(int kind) Gets collection of subfolders.
getSubFolders(MailQuery query) Gets collection of subfolders.
getContents(boolean tryToReadCorruptedContents) Get collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
getContents() Get collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
getContents(int kind) Get collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
getContents(MailQuery query) Get collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
getContents(int startIndex, int count) Gets the collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
enumerateFolders() Exposes the enumerator, which supports an iteration of subfolders in folder.
enumerateFolders(int kind) Exposes the enumerator, which supports an iteration of subfolders in folder.
enumerateMessages() Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMessageObjects() Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMapiMessages() Exposes the enumerator, which supports an iteration of messages in folder.
enumerateMessagesEntryId() Enumerates the entryID of messages.
retrieveFullPath() Retrieves the full path of folder within the PST file.
addSubFolder(String name, boolean createHierarchy) Adds the new sub-folder.
addSubFolder(String name) Adds the new sub-folder.
addSubFolder(String name, String containerClass) Adds the new subfolder.
addMessage(MapiMessage message) Adds a new message into folder.
addFile(String fileName, String messageClass) Adds a file into pst folder.
addMapiMessageItem(IMapiMessageItem item) Adds the IMapiMessageItem object into folder.
addMessages(Iterable messages) Provides message adding in a bulk mode.
moveContents(FolderInfo newFolder) Moves the contents to a new folder.
moveSubfolders(FolderInfo newFolder) Moves the subfolders to a new parent folder.
mergeWith(FolderInfo sourceFolder) Merges the folder with the folder from another pst.
mergeWith(FolderInfo sourceFolder, boolean recursiveHandler) Merges the folder with the folder from another pst.
deleteChildItem(byte[] entryId) Deletes the item (folder or message) by it’s entryId.
deleteChildItems(Iterable entryIdCollection) Deletes the child messages.
updateMessage(String entryId, MapiMessageItemBase updatedMessage) Updates the message in folder.
changeMessages(Iterable entryIdCollection, MapiPropertyCollection updatedProperties) Changes the messages in folder.
changeMessages(MapiPropertyCollection updatedProperties) Changes all messages in folder.
changeContainerClass(String containerClass) Changes the container class.
changeDisplayName(String newName) Changes the display name.

FolderInfo()

public FolderInfo()

Initializes a new instance of the FolderInfo class.

MessageAdded

public final Event<MessageAddedEventHandler> MessageAdded

Occurs when a message is added to the current folder.

ItemMoved

public Event<ItemMovedEventHandler> ItemMoved

Occurs when an item is moved to the another folder.

getDisplayName()

public final String getDisplayName()

Gets the display name of folder.

Value: The display name.

Returns: java.lang.String

getContentCount()

public final int getContentCount()

Gets the total number of items in the folder.

Value: The content count.

Returns: int

getContentUnreadCount()

public final int getContentUnreadCount()

Gets the number of unread items in the folder.

Value: The content unread count.

Returns: int

hasSubFolders()

public final boolean hasSubFolders()

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

Value: The has sub folders.

Returns: boolean

getContainerClass()

public final String getContainerClass()

Gets container class of the folder object.

Value: The container class.

Returns: java.lang.String

getLastModificationTime()

public final 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: java.util.Date

getEntryId()

public final byte[] getEntryId()

Gets the entry ID.

Value: The entry id.

Returns: byte[]

getEntryIdString()

public final String getEntryIdString()

Gets string representation of entry ID.

Value: The entry id string.

Returns: java.lang.String

getProperties()

public final MapiPropertyCollection getProperties()

Gets the folder properties.

Returns: MapiPropertyCollection

getSubFolder(String name)

public final FolderInfo getSubFolder(String name)

Get subfolder.

Parameters:

Parameter Type Description
name java.lang.String Name of subfolder.

Returns: FolderInfo - A FolderInfo object.

getSubFolder(String name, boolean ignoreCase)

public final FolderInfo getSubFolder(String name, boolean ignoreCase)

Gets the subfolder.

Parameters:

Parameter Type Description
name java.lang.String Name of subfolder.
ignoreCase boolean Indicates that a search should ignore case sensitivity when matching the folder name.

Returns: FolderInfo - A FolderInfo object.

getSubFolders()

public final FolderInfoCollection getSubFolders()

Gets collection of subfolders.

Returns: FolderInfoCollection - The FolderInfo collection.

getSubFolders(int kind)

public final FolderInfoCollection getSubFolders(int kind)

Gets collection of subfolders.

Parameters:

Parameter Type Description
kind int The FolderKind that represents kind of folder.

Returns: FolderInfoCollection - The FolderInfo collection.

getSubFolders(MailQuery query)

public final FolderInfoCollection getSubFolders(MailQuery query)

Gets collection of subfolders.

Parameters:

Parameter Type Description
query MailQuery MailQuery that represents search query.

Returns: FolderInfoCollection - The FolderInfo collection.

getContents(boolean tryToReadCorruptedContents)

public final MessageInfoCollection getContents(boolean tryToReadCorruptedContents)

Get collection of messages. Method is used to display brief message information MessageInfo like subject, sender, recipients. In terms of performance, this is the most suitable option for obtaining primary information about messages. To extract complete message data, the PersonalStorage#extractMessage(MessageInfo) method is provided.

Parameters:

Parameter Type Description
tryToReadCorruptedContents boolean 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: MessageInfoCollection - Collection of MessageInfo.

getContents()

public final MessageInfoCollection getContents()

Get collection of messages. Method is used to display brief message information MessageInfo like subject, sender, recipients. In terms of performance, this is the most suitable option for obtaining primary information about messages. To extract complete message data, the PersonalStorage#extractMessage(MessageInfo) method is provided.

Returns: MessageInfoCollection - Collection of MessageInfo.

getContents(int kind)

public final MessageInfoCollection getContents(int kind)

Get collection of messages. Method is used to display brief message information MessageInfo like subject, sender, recipients. In terms of performance, this is the most suitable option for obtaining primary information about messages. To extract complete message data, the PersonalStorage#extractMessage(MessageInfo) method is provided.

Parameters:

Parameter Type Description
kind int The message kind.

Returns: MessageInfoCollection - Collection of MessageInfo.

getContents(MailQuery query)

public final MessageInfoCollection getContents(MailQuery query)

Get collection of messages. Method is used to display brief message information MessageInfo like subject, sender, recipients. In terms of performance, this is the most suitable option for obtaining primary information about messages. To extract complete message data, the PersonalStorage#extractMessage(MessageInfo) method is provided.

Parameters:

Parameter Type Description
query MailQuery MailQuery that represents search query.

Returns: MessageInfoCollection - Collection of MessageInfo.

getContents(int startIndex, int count)

public final MessageInfoCollection getContents(int startIndex, int count)

Gets the collection of messages. Method is used to display brief message information MessageInfo like subject, sender, recipients. In terms of performance, this is the most suitable option for obtaining primary information about messages. To extract complete message data, the PersonalStorage#extractMessage(MessageInfo) method is provided.

Parameters:

Parameter Type Description
startIndex int The start message index.
count int 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: MessageInfoCollection - Collection of MessageInfo.

enumerateFolders()

public final System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders()

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

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.FolderInfo> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a subfolders in folder.

enumerateFolders(int kind)

public final System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders(int kind)

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

Parameters:

Parameter Type Description
kind int The FolderKind that represents kind of folder.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.FolderInfo> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a subfolders in folder.

enumerateMessages()

public final System.Collections.Generic.IGenericEnumerable<MessageInfo> enumerateMessages()

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

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.MessageInfo> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a messages in folder.

enumerateMessageObjects()

public final System.Collections.Generic.IGenericEnumerable<MessageObject> enumerateMessageObjects()

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

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.MessageObject> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a messages in folder.

enumerateMapiMessages()

public final System.Collections.Generic.IGenericEnumerable<MapiMessage> enumerateMapiMessages()

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

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.email.MapiMessage> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through a messages in folder.

enumerateMessagesEntryId()

public final System.Collections.Generic.IGenericEnumerable<String> enumerateMessagesEntryId()

Enumerates the entryID of messages.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<java.lang.String> - ``` System.Collections.Generic.IEnumerableltTgt ```, that represents an enumerator that iterates through entryID of messages in folder.

retrieveFullPath()

public final String retrieveFullPath()

Retrieves the full path of folder within the PST file.

Returns: java.lang.String - The string that represents the full path.

addSubFolder(String name, boolean createHierarchy)

public final FolderInfo addSubFolder(String name, boolean createHierarchy)

Adds the new sub-folder.

Parameters:

Parameter Type Description
name java.lang.String The name of sub-folder.
createHierarchy boolean if set to ``` true ```, it is possible to create a folder hierarchy using string notation. Backslash (’\’) is used as path separator.

Returns: FolderInfo - The new sub-folder.

addSubFolder(String name)

public final FolderInfo addSubFolder(String name)

Adds the new sub-folder.

Parameters:

Parameter Type Description
name java.lang.String The name of sub-folder.

Returns: FolderInfo - The new sub-folder.

addSubFolder(String name, String containerClass)

public final FolderInfo addSubFolder(String name, String containerClass)

Adds the new subfolder.

Parameters:

Parameter Type Description
name java.lang.String The name of subfolder.
containerClass java.lang.String Container class of the sub-Folder object.

Returns: FolderInfo - The new subfolder.

addMessage(MapiMessage message)

public final String addMessage(MapiMessage message)

Adds a new message into folder.

Parameters:

Parameter Type Description
message MapiMessage The message necessary to add.

Returns: java.lang.String - The string that represents the EntryId of the added message.

addFile(String fileName, String messageClass)

public final String addFile(String fileName, String messageClass)

Adds a file into pst folder.

Parameters:

Parameter Type Description
fileName java.lang.String The name of file necessary to add.
messageClass java.lang.String The message class.

Returns: java.lang.String - The string that represents the EntryId of the added message.

addMapiMessageItem(IMapiMessageItem item)

public final String addMapiMessageItem(IMapiMessageItem item)

Adds the IMapiMessageItem object into folder.

Parameters:

Parameter Type Description
item IMapiMessageItem The item necessary to add.

Returns: java.lang.String - The string that represents the EntryId of the added item.

addMessages(Iterable messages)

public final void addMessages(Iterable<MapiMessage> messages)

Provides message adding in a bulk mode.

Parameters:

Parameter Type Description
messages java.lang.Iterable<com.aspose.email.MapiMessage> An IEnumerator representing the enumerator, which supports iteration over a collection of MapiMessage.

moveContents(FolderInfo newFolder)

public final void moveContents(FolderInfo newFolder)

Moves the contents to a new folder.

Parameters:

Parameter Type Description
newFolder FolderInfo The new folder.

moveSubfolders(FolderInfo newFolder)

public final void moveSubfolders(FolderInfo newFolder)

Moves the subfolders to a new parent folder.

Parameters:

Parameter Type Description
newFolder FolderInfo The new parent folder.

mergeWith(FolderInfo sourceFolder)

public final void mergeWith(FolderInfo sourceFolder)

Merges the folder with the folder from another pst.

Parameters:

Parameter Type Description
sourceFolder FolderInfo The source folder.

mergeWith(FolderInfo sourceFolder, boolean recursiveHandler)

public final void mergeWith(FolderInfo sourceFolder, boolean recursiveHandler)

Merges the folder with the folder from another pst. OnItemMoved event is called on both messages and directories.

Parameters:

Parameter Type Description
sourceFolder FolderInfo The source folder.
recursiveHandler boolean If true, OnItemMoved will be called on all messages, including messages in sub-directories, otherwise OnItemMoved will be called only for messages in the current directory.

deleteChildItem(byte[] entryId)

public final void deleteChildItem(byte[] entryId)

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

Parameters:

Parameter Type Description
entryId byte[] The entry id.

The item must be contained in a folder. |

deleteChildItems(Iterable entryIdCollection)

public final void deleteChildItems(Iterable<String> entryIdCollection)

Deletes the child messages.

Parameters:

Parameter Type Description
entryIdCollection java.lang.Iterable<java.lang.String> The entry id collection.

updateMessage(String entryId, MapiMessageItemBase updatedMessage)

public final void updateMessage(String entryId, MapiMessageItemBase updatedMessage)

Updates the message in folder.

Parameters:

Parameter Type Description
entryId java.lang.String The message entry identifier.
updatedMessage MapiMessageItemBase The updated message.

changeMessages(Iterable entryIdCollection, MapiPropertyCollection updatedProperties)

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

Changes the messages in folder.

Parameters:

Parameter Type Description
entryIdCollection java.lang.Iterable<java.lang.String> The entry identifier collection.
updatedProperties MapiPropertyCollection The updated properties.

changeMessages(MapiPropertyCollection updatedProperties)

public final void changeMessages(MapiPropertyCollection updatedProperties)

Changes all messages in folder.

Parameters:

Parameter Type Description
updatedProperties MapiPropertyCollection The updated properties.

changeContainerClass(String containerClass)

public final void changeContainerClass(String containerClass)

Changes the container class.

Parameters:

Parameter Type Description
containerClass java.lang.String Container class of the of the folder object.

changeDisplayName(String newName)

public final void changeDisplayName(String newName)

Changes the display name.

Parameters:

Parameter Type Description
newName java.lang.String A new name.