public final class FolderInfo extends Object
Represents information about personal folder in PST.
Modifier and Type | Field and Description |
---|---|
com.aspose.ms.lang.Event<ItemMovedEventHandler> |
ItemMoved
Occurs when an item is moved to the another folder.
|
com.aspose.ms.lang.Event<MessageAddedEventHandler> |
MessageAdded
Occurs when a message is added to the current folder.
|
Constructor and Description |
---|
FolderInfo()
Initializes a new instance of the
FolderInfo class. |
Modifier and Type | Method and Description |
---|---|
String |
addFile(String fileName,
String messageClass)
Adds a file into pst folder.
|
String |
addMapiMessageItem(IMapiMessageItem item)
Adds the IMapiMessageItem object into folder.
|
String |
addMessage(MapiMessage message)
Adds a new message into folder.
|
void |
addMessages(Iterable<MapiMessage> messages)
Provides message adding in a bulk mode.
|
FolderInfo |
addSubFolder(String name)
Adds the new subfolder.
|
FolderInfo |
addSubFolder(String name,
String containerClass)
Adds the new subfolder.
|
void |
changeContainerClass(String containerClass)
Changes the container class.
|
void |
changeDisplayName(String newName)
Changes the display name.
|
void |
changeMessages(Iterable<String> entryIdCollection,
MapiPropertyCollection updatedProperties)
Changes the messages in folder.
|
void |
changeMessages(MapiPropertyCollection updatedProperties)
Changes all messages in folder.
|
void |
deleteChildItem(byte[] entryId)
Deletes the item (folder or message) by it's entryId.
|
void |
deleteChildItems(Iterable<String> entryIdCollection)
Deletes the child messages.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> |
enumerateFolders()
Exposes the enumerator, which supports an iteration of subfolders in folder.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> |
enumerateFolders(int kind)
Exposes the enumerator, which supports an iteration of subfolders in folder.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MapiMessage> |
enumerateMapiMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageObject> |
enumerateMessageObjects()
Exposes the enumerator, which supports an iteration of messages in folder.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageInfo> |
enumerateMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<String> |
enumerateMessagesEntryId()
Enumerates the entryID of messages.
|
String |
getContainerClass()
Gets container class of the folder object.
|
int |
getContentCount()
Gets the total number of items in the folder.
|
MessageInfoCollection |
getContents()
Get collection of messages.
|
MessageInfoCollection |
getContents(boolean tryToReadCorruptedContents)
Get collection of messages.
|
MessageInfoCollection |
getContents(int kind)
Get collection of messages.
|
MessageInfoCollection |
getContents(int startIndex,
int count)
Gets the collection of messages.
|
MessageInfoCollection |
getContents(MailQuery query)
Get collection of messages.
|
int |
getContentUnreadCount()
Gets the number of unread items in the folder.
|
String |
getDisplayName()
Gets the display name of folder.
|
byte[] |
getEntryId()
Gets the entry ID.
|
String |
getEntryIdString()
Gets string representation of entry ID.
|
Date |
getLastModificationTime()
Gets the last modification time.
|
MapiPropertyCollection |
getProperties()
Gets the folder properties.
|
FolderInfo |
getSubFolder(String name)
Get subfolder.
|
FolderInfo |
getSubFolder(String name,
boolean ignoreCase)
Gets the subfolder.
|
FolderInfoCollection |
getSubFolders()
Gets collection of subfolders.
|
FolderInfoCollection |
getSubFolders(int kind)
Gets collection of subfolders.
|
FolderInfoCollection |
getSubFolders(MailQuery query)
Gets collection of subfolders.
|
boolean |
hasSubFolders()
Gets a value indicating whether the Folder object has any subfolders.
|
void |
mergeWith(FolderInfo sourceFolder)
Merges the folder with the folder from another pst.
|
void |
mergeWith(FolderInfo sourceFolder,
boolean recursiveHandler)
Merges the folder with the folder from another pst.
|
void |
moveContents(FolderInfo newFolder)
Moves the contents to a new folder.
|
void |
moveSubfolders(FolderInfo newFolder)
Moves the subfolders to a new parent folder.
|
String |
retrieveFullPath()
Retrieves the full path of folder within the PST file.
|
public final com.aspose.ms.lang.Event<MessageAddedEventHandler> MessageAdded
Occurs when a message is added to the current folder.
public com.aspose.ms.lang.Event<ItemMovedEventHandler> ItemMoved
Occurs when an item is moved to the another folder.
public FolderInfo()
Initializes a new instance of the FolderInfo
class.
public String getDisplayName()
Gets the display name of folder.
Value: The display name.public int getContentCount()
Gets the total number of items in the folder.
Value: The content count.public int getContentUnreadCount()
Gets the number of unread items in the folder.
Value: The content unread count.public boolean hasSubFolders()
Gets a value indicating whether the Folder object has any subfolders.
Value: The has sub folders.public String getContainerClass()
Gets container class of the folder object.
Value: The container class.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.public byte[] getEntryId()
Gets the entry ID.
Value: The entry id.public String getEntryIdString()
Gets string representation of entry ID.
Value: The entry id string.public MapiPropertyCollection getProperties()
Gets the folder properties.
public FolderInfo getSubFolder(String name)
Get subfolder.
name
- Name of subfolder.public FolderInfo getSubFolder(String name, boolean ignoreCase)
Gets the subfolder.
name
- Name of subfolder.ignoreCase
- Indicates that a search should ignore case sensitivity when matching the folder name.public FolderInfoCollection getSubFolders()
Gets collection of subfolders.
public FolderInfoCollection getSubFolders(int kind)
Gets collection of subfolders.
kind
- The FolderKind
that represents kind of folder.public FolderInfoCollection getSubFolders(MailQuery query)
Gets collection of subfolders.
query
- MailQuery
that represents search query.public MessageInfoCollection getContents(boolean tryToReadCorruptedContents)
Get collection of messages.
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.public MessageInfoCollection getContents()
Get collection of messages.
public MessageInfoCollection getContents(int kind)
Get collection of messages.
kind
- The message kind.public MessageInfoCollection getContents(MailQuery query)
Get collection of messages.
query
- MailQuery
that represents search query.public MessageInfoCollection getContents(int startIndex, int count)
Gets the collection of messages.
startIndex
- The start message index.count
- The number of messages that will be retrieved.
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.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders()
Exposes the enumerator, which supports an iteration of subfolders in folder.
System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a subfolders in folder.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<FolderInfo> enumerateFolders(int kind)
Exposes the enumerator, which supports an iteration of subfolders in folder.
kind
- The FolderKind
that represents kind of folder.System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a subfolders in folder.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageInfo> enumerateMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a messages in folder.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MessageObject> enumerateMessageObjects()
Exposes the enumerator, which supports an iteration of messages in folder.
System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a messages in folder.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<MapiMessage> enumerateMapiMessages()
Exposes the enumerator, which supports an iteration of messages in folder.
System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through a messages in folder.public com.aspose.ms.System.Collections.Generic.IGenericEnumerable<String> enumerateMessagesEntryId()
Enumerates the entryID of messages.
System.Collections.Generic.IEnumerableltTgt
,
that represents an enumerator that iterates through entryID of messages in folder.public String retrieveFullPath()
Retrieves the full path of folder within the PST file.
public FolderInfo addSubFolder(String name)
Adds the new subfolder.
name
- The name of subfolder.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.public FolderInfo addSubFolder(String name, String containerClass)
Adds the new subfolder.
name
- The name of subfolder.containerClass
- Container class of the sub-Folder object.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.public String addMessage(MapiMessage message)
Adds a new message into folder.
message
- The message necessary to add.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.public String addFile(String fileName, String messageClass)
Adds a file into pst folder.
fileName
- The name of file necessary to add.messageClass
- The message class.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.public String addMapiMessageItem(IMapiMessageItem item)
Adds the IMapiMessageItem object into folder.
item
- The item necessary to add.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.public void addMessages(Iterable<MapiMessage> messages)
Provides message adding in a bulk mode.
messages
- An T:System.Collections.IEnumerator
representing the enumerator, which supports iteration over a collection of MapiMessage
.public void moveContents(FolderInfo newFolder)
Moves the contents to a new folder.
newFolder
- The new folder.public void moveSubfolders(FolderInfo newFolder)
Moves the subfolders to a new parent folder.
newFolder
- The new parent folder.public void mergeWith(FolderInfo sourceFolder)
Merges the folder with the folder from another pst.
sourceFolder
- The source folder.com.aspose.ms.System.InvalidOperationException
- Throws when the source folder is located in the same pst.public void mergeWith(FolderInfo sourceFolder, boolean recursiveHandler)
Merges the folder with the folder from another pst. OnItemMoved event is called on both messages and directories.
sourceFolder
- The source folder.recursiveHandler
- 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.com.aspose.ms.System.InvalidOperationException
- Throws when the source folder is located in the same pst.public void deleteChildItem(byte[] entryId)
Deletes the item (folder or message) by it's entryId.
entryId
- The entry id.
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.public void deleteChildItems(Iterable<String> entryIdCollection)
Deletes the child messages.
entryIdCollection
- The entry id collection.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.public void changeMessages(Iterable<String> entryIdCollection, MapiPropertyCollection updatedProperties)
Changes the messages in folder.
entryIdCollection
- The entry identifier collection.updatedProperties
- The updated properties.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.public void changeMessages(MapiPropertyCollection updatedProperties)
Changes all messages in folder.
updatedProperties
- The updated properties.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.public void changeContainerClass(String containerClass)
Changes the container class.
containerClass
- Container class of the of the folder object.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.public void changeDisplayName(String newName)
Changes the display name.
newName
- A new name.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.Copyright (c) 2008-2018 Aspose Pty Ltd. All Rights Reserved.