FolderInfo

Inheritance: java.lang.Object

public final class FolderInfo

Represents information about personal folder in PST.

Constructors

ConstructorDescription
FolderInfo()Initializes a new instance of the FolderInfo class.

Fields

FieldDescription
ItemMovedOccurs when an item is moved to the another folder.
MessageAddedOccurs when a message is added to the current folder.

Methods

MethodDescription
addFile(String fileName, String messageClass)Adds a file into pst folder.
addMapiMessageItem(IMapiMessageItem item)Adds the IMapiMessageItem object into folder.
addMessage(MapiMessage message)Adds a new message into folder.
addMessages(Iterable messages)Provides message adding in a bulk mode.
addSubFolder(String name)Adds the new sub-folder.
addSubFolder(String name, boolean createHierarchy)Adds the new sub-folder.
addSubFolder(String name, String containerClass)Adds the new subfolder.
changeContainerClass(String containerClass)Changes the container class.
changeDisplayName(String newName)Changes the display name.
changeMessages(MapiPropertyCollection updatedProperties)Changes all messages in folder.
changeMessages(Iterable entryIdCollection, MapiPropertyCollection updatedProperties)Changes the messages in folder.
deleteChildItem(byte[] entryId)Deletes the item (folder or message) by it’s entryId.
deleteChildItems(Iterable entryIdCollection)Deletes the child messages.
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.
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.
equals(Object arg0)
getClass()
getContainerClass()Gets container class of the folder object.
getContentCount()Gets the total number of items in the folder.
getContentUnreadCount()Gets the number of unread items in the folder.
getContents()Get collection of messages.
Method is used to display brief message information MessageInfo like subject, sender, recipients.
getContents(boolean tryToReadCorruptedContents)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 kind)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.
getDisplayName()Gets the display name of folder.
getEntryId()Gets the entry ID.
getEntryIdString()Gets string representation of entry ID.
getLastModificationTime()Gets the last modification time.
getProperties()Gets the folder properties.
getSubFolder(String name)Get subfolder.
getSubFolder(String name, boolean ignoreCase)Gets the subfolder.
getSubFolders()Gets collection of subfolders.
getSubFolders(MailQuery query)Gets collection of subfolders.
getSubFolders(int kind)Gets collection of subfolders.
hasSubFolders()Gets a value indicating whether the Folder object has any subfolders.
hashCode()
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.
moveContents(FolderInfo newFolder)Moves the contents to a new folder.
moveSubfolders(FolderInfo newFolder)Moves the subfolders to a new parent folder.
notify()
notifyAll()
retrieveFullPath()Retrieves the full path of folder within the PST file.
toString()
updateMessage(String entryId, MapiMessageItemBase updatedMessage)Updates the message in folder.
wait()
wait(long arg0)
wait(long arg0, int arg1)

FolderInfo()

public FolderInfo()

Initializes a new instance of the FolderInfo class.

ItemMoved

public Event<ItemMovedEventHandler> ItemMoved

Occurs when an item is moved to the another folder.

MessageAdded

public final Event<MessageAddedEventHandler> MessageAdded

Occurs when a message is added to the current folder.

addFile(String fileName, String messageClass)

public final String addFile(String fileName, String messageClass)

Adds a file into pst folder.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringThe name of file necessary to add.
messageClassjava.lang.StringThe 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:

ParameterTypeDescription
itemIMapiMessageItemThe item necessary to add.

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

addMessage(MapiMessage message)

public final String addMessage(MapiMessage message)

Adds a new message into folder.

Parameters:

ParameterTypeDescription
messageMapiMessageThe message necessary to add.

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

addMessages(Iterable messages)

public final void addMessages(Iterable<MapiMessage> messages)

Provides message adding in a bulk mode.

Parameters:

ParameterTypeDescription
messagesjava.lang.Iterable<com.aspose.email.MapiMessage>An IEnumerator representing the enumerator, which supports iteration over a collection of MapiMessage.

addSubFolder(String name)

public final FolderInfo addSubFolder(String name)

Adds the new sub-folder.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of sub-folder.

Returns: FolderInfo - The new sub-folder.

addSubFolder(String name, boolean createHierarchy)

public final FolderInfo addSubFolder(String name, boolean createHierarchy)

Adds the new sub-folder.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of sub-folder.
createHierarchybooleanif 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, String containerClass)

public final FolderInfo addSubFolder(String name, String containerClass)

Adds the new subfolder.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of subfolder.
containerClassjava.lang.StringContainer class of the sub-Folder object.

Returns: FolderInfo - The new subfolder.

changeContainerClass(String containerClass)

public final void changeContainerClass(String containerClass)

Changes the container class.

Parameters:

ParameterTypeDescription
containerClassjava.lang.StringContainer class of the of the folder object.

changeDisplayName(String newName)

public final void changeDisplayName(String newName)

Changes the display name.

Parameters:

ParameterTypeDescription
newNamejava.lang.StringA new name.

changeMessages(MapiPropertyCollection updatedProperties)

public final void changeMessages(MapiPropertyCollection updatedProperties)

Changes all messages in folder.

Parameters:

ParameterTypeDescription
updatedPropertiesMapiPropertyCollectionThe updated properties.

changeMessages(Iterable entryIdCollection, MapiPropertyCollection updatedProperties)

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

Changes the messages in folder.

Parameters:

ParameterTypeDescription
entryIdCollectionjava.lang.Iterable<java.lang.String>The entry identifier collection.
updatedPropertiesMapiPropertyCollectionThe updated properties.

deleteChildItem(byte[] entryId)

public final void deleteChildItem(byte[] entryId)

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

Parameters:

ParameterTypeDescription
entryIdbyte[]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:

ParameterTypeDescription
entryIdCollectionjava.lang.Iterable<java.lang.String>The entry id collection.

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:

ParameterTypeDescription
kindintThe 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.

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.

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.

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.

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.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getContainerClass()

public final String getContainerClass()

Gets container class of the folder object.

Value: The container class.

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

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(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:

ParameterTypeDescription
tryToReadCorruptedContentsbooleanIf 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(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:

ParameterTypeDescription
queryMailQueryMailQuery that represents search query.

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:

ParameterTypeDescription
kindintThe message kind.

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:

ParameterTypeDescription
startIndexintThe start message index.
countintThe 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.

getDisplayName()

public final String getDisplayName()

Gets the display name of folder.

Value: The display name.

Returns: java.lang.String

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

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

getProperties()

public final MapiPropertyCollection getProperties()

Gets the folder properties.

Returns: MapiPropertyCollection

getSubFolder(String name)

public final FolderInfo getSubFolder(String name)

Get subfolder.

Parameters:

ParameterTypeDescription
namejava.lang.StringName of subfolder.

Returns: FolderInfo - A FolderInfo object.

getSubFolder(String name, boolean ignoreCase)

public final FolderInfo getSubFolder(String name, boolean ignoreCase)

Gets the subfolder.

Parameters:

ParameterTypeDescription
namejava.lang.StringName of subfolder.
ignoreCasebooleanIndicates 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(MailQuery query)

public final FolderInfoCollection getSubFolders(MailQuery query)

Gets collection of subfolders.

Parameters:

ParameterTypeDescription
queryMailQueryMailQuery that represents search query.

Returns: FolderInfoCollection - The FolderInfo collection.

getSubFolders(int kind)

public final FolderInfoCollection getSubFolders(int kind)

Gets collection of subfolders.

Parameters:

ParameterTypeDescription
kindintThe FolderKind that represents kind of folder.

Returns: FolderInfoCollection - The FolderInfo collection.

hasSubFolders()

public final boolean hasSubFolders()

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

Value: The has sub folders.

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

mergeWith(FolderInfo sourceFolder)

public final void mergeWith(FolderInfo sourceFolder)

Merges the folder with the folder from another pst.

Parameters:

ParameterTypeDescription
sourceFolderFolderInfoThe 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:

ParameterTypeDescription
sourceFolderFolderInfoThe source folder.
recursiveHandlerbooleanIf 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.

moveContents(FolderInfo newFolder)

public final void moveContents(FolderInfo newFolder)

Moves the contents to a new folder.

Parameters:

ParameterTypeDescription
newFolderFolderInfoThe new folder.

moveSubfolders(FolderInfo newFolder)

public final void moveSubfolders(FolderInfo newFolder)

Moves the subfolders to a new parent folder.

Parameters:

ParameterTypeDescription
newFolderFolderInfoThe new parent folder.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

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.

toString()

public String toString()

Returns: java.lang.String

updateMessage(String entryId, MapiMessageItemBase updatedMessage)

public final void updateMessage(String entryId, MapiMessageItemBase updatedMessage)

Updates the message in folder.

Parameters:

ParameterTypeDescription
entryIdjava.lang.StringThe message entry identifier.
updatedMessageMapiMessageItemBaseThe updated message.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int