PersonalStorage
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.ms.System.IDisposable, java.io.Closeable
public class PersonalStorage implements System.IDisposable, Closeable
Provides functionality to access and manipulate the PST (Personal Storage Table) files used by Microsoft Outlook.
The PersonalStorage class encapsulates methods for creating, opening, and working with the contents of PST files including emails, appointments, contacts, tasks, and other personal information.
Example:
// Open the PST file by creating an instance of PersonalStorage
try (PersonalStorage pst = PersonalStorage.fromFile("storage.pst")) {
// Retrieve the total number of items in the PST file
int totalItemsCount = pst.getStore().getTotalItemsCount();
// Write the total items count to the console
System.out.println("Total items count: " + totalItemsCount);
// Iterate through each subfolder within the root folder of the PST
for (FolderInfo folderInfo : pst.getRootFolder().getSubFolders()) {
// Write the display name of the folder to the console
System.out.println("Folder: " + folderInfo.getDisplayName());
// Write the total number of items in the folder to the console
System.out.println("Total items: " + folderInfo.getContentCount());
// Write the count of unread items in the folder to the console
System.out.println("Total unread items: " + folderInfo.getContentUnreadCount());
// Enumerate through each message in the current folder
for (MessageInfo messageInfo : folderInfo.enumerateMessages()) {
// Write the subject of the message to the console
System.out.println("Subject: " + messageInfo.getSubject());
// Extract the full message object from the messageInfo
MapiMessage msg = pst.extractMessage(messageInfo);
// Save the message as a .msg file, using its subject as the filename
msg.save(msg.getSubject() + ".msg");
}
}
} catch (Exception e) {
e.printStackTrace();
}
Constructors
Constructor | Description |
---|---|
PersonalStorage(TraversalExceptionsCallback callback) | Initializes a new instance of the PersonalStorage class. |
Fields
Field | Description |
---|---|
ItemMoved | Occurs when an item is moved to the another folder. |
StorageProcessed | Occurs in splitting and merging operations when a new chunk of pst is created or the next file is processed and is to be merged. |
StorageProcessing | Occurs before the srorage is processed. |
Methods
PersonalStorage(TraversalExceptionsCallback callback)
public PersonalStorage(TraversalExceptionsCallback callback)
Initializes a new instance of the PersonalStorage class. Allows setting a callback method for handling exceptions that occur during PST traversal.
Parameters:
Parameter | Type | Description |
---|---|---|
callback | TraversalExceptionsCallback | The exception callback. |
ItemMoved
public final Event<ItemMovedEventHandler> ItemMoved
Occurs when an item is moved to the another folder.
StorageProcessed
public final Event<StorageProcessedEventHandler> StorageProcessed
Occurs in splitting and merging operations when a new chunk of pst is created or the next file is processed and is to be merged.
StorageProcessing
public final Event<StorageProcessingEventHandler> StorageProcessing
Occurs before the srorage is processed. The event is raised before processing the next storage in merging or splitting operations.
canWrite()
public final boolean canWrite()
Gets a value indicating whether the current pst supports writing.
Returns: boolean
changeMessage(String entryId, MapiPropertyCollection updatedProperties)
public final void changeMessage(String entryId, MapiPropertyCollection updatedProperties)
Changes the message properties.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The entry identifier of message. |
updatedProperties | MapiPropertyCollection | The updated properties. |
close()
public void close()
convertTo(int format)
public final void convertTo(int format)
Converts the current object to the specified format.
Parameters:
Parameter | Type | Description |
---|---|---|
format | int | The FileFormat to convert the current object to. |
It is used for the fast OST to PST conversion. The method doesn’t support conversion of OST created by MS Office 2013 and later versions. To convert an OST of later version, create a new PST and use the #mergeWith(Stream[]).mergeWith(Stream[]) method. |
create(System.IO.Stream stream, int version)
public static PersonalStorage create(System.IO.Stream stream, int version)
Creates the PST in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The stream in which PST is created. |
version | int | The PST file version. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(System.IO.Stream stream, int version, boolean leaveStreamOpen)
public static PersonalStorage create(System.IO.Stream stream, int version, boolean leaveStreamOpen)
Creates the PST in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The stream in which PST is created. |
version | int | The PST file version. |
leaveStreamOpen | boolean | Leave stream open when PersonalStorage is disposed. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(OutputStream stream, int version)
public static PersonalStorage create(OutputStream stream, int version)
Creates the PST in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The stream in which PST is created. |
version | int | The PST file version. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(OutputStream stream, int version, boolean leaveStreamOpen)
public static PersonalStorage create(OutputStream stream, int version, boolean leaveStreamOpen)
Creates the PST in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The stream in which PST is created. |
version | int | The PST file version. |
leaveStreamOpen | boolean | Leave stream open when PersonalStorage is disposed. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(OutputStream stream, int blockSize, int version)
public static PersonalStorage create(OutputStream stream, int blockSize, int version)
Creates the PST in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The stream in which PST is created. |
blockSize | int | The optimal block size to expand cache buffer(in bytes). |
version | int | The PST file version. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(String fileName, int version)
public static PersonalStorage create(String fileName, int version)
Creates the new PST file with the specified file name.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The full name of the file. |
version | int | The PST file version. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
create(SeekableByteChannel channel, int version)
public static PersonalStorage create(SeekableByteChannel channel, int version)
Creates the PST in a java.nio.channels.
Parameters:
Parameter | Type | Description |
---|---|---|
channel | java.nio.channels.SeekableByteChannel | The java.nio.channel in which PST is created. |
version | int | The PST file version. |
Note, only Unicode file version creation is supported now. |
Returns: PersonalStorage - A PersonalStorage object that represents the new PST.
createPredefinedFolder(String name, int defaultFolder)
public final FolderInfo createPredefinedFolder(String name, int defaultFolder)
Creates the standard interpersonal message (IPM) folder.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of folder. |
defaultFolder | int | The value of StandardIpmFolder enumeration. |
Returns: FolderInfo - A FolderInfo object that represents a standard IPM folder.
createPredefinedFolder(String name, int defaultFolder, boolean createHierarchy)
public final FolderInfo createPredefinedFolder(String name, int defaultFolder, boolean createHierarchy)
Creates the standard interpersonal message (IPM) folder.
Parameters:
Parameter | Type | Description |
---|---|---|
name | java.lang.String | The name of folder. |
defaultFolder | int | The value of StandardIpmFolder enumeration. |
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 - A FolderInfo object that represents a standard IPM folder.
deleteItem(String entryId)
public final void deleteItem(String entryId)
Deletes the item (folder or message) by it’s entryId
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String |
dispose()
public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
enumerateMessages(String entryId)
public final System.Collections.Generic.IGenericEnumerable<MessageInfo> enumerateMessages(String entryId)
Exposes the enumerator, which supports an iteration of messages in folder.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The string that represents a parent folder entry ID. |
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.
enumerateMessages(String entryId, int startIndex, int count)
public final System.Collections.Generic.IGenericEnumerable<MessageInfo> enumerateMessages(String entryId, int startIndex, int count)
Exposes the enumerator, which supports an iteration of messages in folder.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The string that represents a parent folder entry ID. |
startIndex | int | The start message index. |
count | int | The number of messages that will be retrieved. |
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.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
extractAttachments(MessageInfo messageInfo)
public final MapiAttachmentCollection extractAttachments(MessageInfo messageInfo)
Extracts the attachments.
Parameters:
Parameter | Type | Description |
---|---|---|
messageInfo | MessageInfo | The message information. |
Returns: MapiAttachmentCollection - The MapiAttachmentCollection that represents the collection of attachments.
extractAttachments(String entryId)
public final MapiAttachmentCollection extractAttachments(String entryId)
Extracts the attachments.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The message entryId. |
Returns: MapiAttachmentCollection - The MapiAttachmentCollection that represents the collection of attachments.
extractMessage(byte[] entryId)
public final MapiMessage extractMessage(byte[] entryId)
Get the message from PST.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | byte[] | EntryId of message. |
Returns: MapiMessage - A MapiMessage object.
extractMessage(MessageInfo messageInfo)
public final MapiMessage extractMessage(MessageInfo messageInfo)
Get the message from PST.
Parameters:
Parameter | Type | Description |
---|---|---|
messageInfo | MessageInfo | A MessageInfo object that represents information about message. |
Returns: MapiMessage - A MapiMessage object.
extractMessage(String entryId)
public final MapiMessage extractMessage(String entryId)
Get the message from PST.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | String representation of EntryId. |
Returns: MapiMessage - A MapiMessage object.
extractProperty(byte[] entryId, long tag)
public final MapiProperty extractProperty(byte[] entryId, long tag)
Gets the specified property of item, without extract the item fully.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | byte[] | The entry id of item. |
tag | long | The property tag. |
If a property is not found, null is returned. |
Returns: MapiProperty - The MapiProperty.
extractRecipients(MessageInfo messageInfo)
public final MapiRecipientCollection extractRecipients(MessageInfo messageInfo)
Extracts the recipients.
Parameters:
Parameter | Type | Description |
---|---|---|
messageInfo | MessageInfo | The message information. |
Returns: MapiRecipientCollection - The MapiRecipientCollection that represents the collection of recipients.
extractRecipients(String entryId)
public final MapiRecipientCollection extractRecipients(String entryId)
Extracts the recipients.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The message entryId. |
Returns: MapiRecipientCollection - The MapiRecipientCollection that represents the collection of recipients.
findAndExtractSoftDeletedItems()
public final System.Collections.Generic.IGenericList<RestoredItemEntry> findAndExtractSoftDeletedItems()
Finds and extracts soft-deleted messages from the PST.
Returns: com.aspose.ms.System.Collections.Generic.IGenericList<com.aspose.email.RestoredItemEntry> - A list of RestoredItemEntry objects, each containing a soft-deleted message and the folder Id it was originally located in.
findMessages(String parentEntryId)
public final System.Collections.Generic.IGenericList<String> findMessages(String parentEntryId)
Finds the identifiers of messages for for the current folder. It might be useful in case of reading corrupted pst when the GetContents and EnumerateMessages methods could throw an exception.
Parameters:
Parameter | Type | Description |
---|---|---|
parentEntryId | java.lang.String | Entry id of the parent folder. |
Returns: com.aspose.ms.System.Collections.Generic.IGenericList<java.lang.String> - Collection of entry Ids.
findSubfolders(String parentEntryId)
public final System.Collections.Generic.IGenericList<String> findSubfolders(String parentEntryId)
Finds the identifiers of subfolders for for the current folder. It might be useful in case of reading corrupted pst when the GetSubfolders and EnumerateFolders methods could throw an exception.
Parameters:
Parameter | Type | Description |
---|---|---|
parentEntryId | java.lang.String | Entry id of the parent folder. |
Returns: com.aspose.ms.System.Collections.Generic.IGenericList<java.lang.String> - Collection of entry Ids.
fromFile(String fileName)
public static PersonalStorage fromFile(String fileName)
Load PST from file.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | Name of .pst file. |
By default, the pst will support writing. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromFile(String fileName, boolean writable)
public static PersonalStorage fromFile(String fileName, boolean writable)
Load PST from file.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | Name of .pst file. |
writable | boolean | if set to true then the the pst file will support writing, otherwise it will be opened in read-only mode. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromFile(String fileName, PersonalStorageLoadOptions loadOptions)
public static PersonalStorage fromFile(String fileName, PersonalStorageLoadOptions loadOptions)
Load PST from file.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | Name of .pst file. |
loadOptions | PersonalStorageLoadOptions | The load options. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(System.IO.Stream stream)
public static PersonalStorage fromStream(System.IO.Stream stream)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The System.IO.Stream. |
By default, the pst will support writing. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(System.IO.Stream stream, boolean writable)
public static PersonalStorage fromStream(System.IO.Stream stream, boolean writable)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The System.IO.Stream. |
writable | boolean | if set to true then the the pst will support writing, otherwise it will be opened in read-only mode. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(System.IO.Stream stream, PersonalStorageLoadOptions loadOptions)
public static PersonalStorage fromStream(System.IO.Stream stream, PersonalStorageLoadOptions loadOptions)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The System.IO.Stream. |
loadOptions | PersonalStorageLoadOptions | The load options. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(InputStream stream)
public static PersonalStorage fromStream(InputStream stream)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The System.IO.Stream. |
By default, the pst will support writing. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(InputStream stream, boolean writable)
public static PersonalStorage fromStream(InputStream stream, boolean writable)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The System.IO.Stream. |
writable | boolean | if set to true then the the pst will support writing, otherwise it will be opened in read-only mode. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
fromStream(InputStream stream, PersonalStorageLoadOptions loadOptions)
public static PersonalStorage fromStream(InputStream stream, PersonalStorageLoadOptions loadOptions)
Load PST from stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The System.IO.Stream. |
loadOptions | PersonalStorageLoadOptions | The load options. |
Returns: PersonalStorage - A PersonalStorage object that represents the current PST.
getCategories()
public final List<PstItemCategory> getCategories()
Retrieves a list of PST item categories, each containing a name and associated color.
Returns: java.util.List<com.aspose.email.PstItemCategory> - A List{PstItemCategory} containing all the available categories. The list will be non-empty if there is at least one item in the store that has the category assigned to it. If no categories are found or an error occurs, the list may be empty.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getFolderById(byte[] entryId)
public final FolderInfo getFolderById(byte[] entryId)
Gets the personal folder from PST.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | byte[] | The Entry id. |
Returns: FolderInfo - A FolderInfo object.
getFolderById(String entryIdString)
public final FolderInfo getFolderById(String entryIdString)
Gets the personal folder from PST.
Parameters:
Parameter | Type | Description |
---|---|---|
entryIdString | java.lang.String | String representation of entry ID. |
Returns: FolderInfo - A FolderInfo object.
getFormat()
public final int getFormat()
Gets the file format.
Value: FileFormat that specifies file format.
The .pst and .ost file formats are supported now.
Returns: int
getParentFolder(byte[] entryId)
public final FolderInfo getParentFolder(byte[] entryId)
Gets the parent folder of message.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | byte[] | Entry Id of message or folder. |
Returns: FolderInfo - The parent folderFolderInfo of message.
getParentFolder(String entryIdString)
public final FolderInfo getParentFolder(String entryIdString)
Gets the parent folder of message.
Parameters:
Parameter | Type | Description |
---|---|---|
entryIdString | java.lang.String | String representation of Entry Id of message or folder. |
Returns: FolderInfo - The parent folderFolderInfo of message.
getPredefinedFolder(int defaultFolder)
public final FolderInfo getPredefinedFolder(int defaultFolder)
Gets the standard interpersonal message (IPM) folder from PST. Outlook can create a number of default folders, such as Outbox, Deleted Items, Sent Items etc.
Parameters:
Parameter | Type | Description |
---|---|---|
defaultFolder | int | The value of StandardIpmFolder enumeration. |
Returns: FolderInfo - A FolderInfo object that represents a standard IPM folder.
getRootFolder()
public final FolderInfo getRootFolder()
Gets the root folder of PST.
Value: FolderInfo that represents a root folder.
Returns: FolderInfo
getStore()
public final MessageStore getStore()
Gets the PST message store.
Value: The MessageStore which is the rough equivalent of the top of a Mailbox.
Returns: MessageStore
hashCode()
public native int hashCode()
Returns: int
isUnicode()
public final boolean isUnicode()
Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI.
Returns: boolean
load(System.IO.Stream stream)
public final boolean load(System.IO.Stream stream)
Load PST from stream. This method is used when a PersonalStorage object is created using the constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | com.aspose.ms.System.IO.Stream | The System.IO.Stream. |
Returns: boolean
load(InputStream stream)
public final boolean load(InputStream stream)
Load PST from stream. This method is used when a PersonalStorage object is created using the constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | The System.IO.Stream. |
Returns: boolean - ’true’ if the file has been loaded successfully and further traversal is possible; otherwise, false.
load(String fileName)
public final boolean load(String fileName)
Load PST from file. This method is used when a PersonalStorage object is created using the constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The name of .pst file. |
Returns: boolean - ’true’ if the file has been loaded successfully and further traversal is possible; otherwise, false.
mergeWith(InputStream[] sourceStreams)
public final void mergeWith(InputStream[] sourceStreams)
Merges the pst storage with one or more other pst streams. Thus, the combined stream are sources.
Parameters:
Parameter | Type | Description |
---|---|---|
sourceStreams | java.io.InputStream[] | The source streams. |
mergeWith(String[] sourceFileNames)
public final void mergeWith(String[] sourceFileNames)
Merges the pst storage with one or more other pst files. Thus, the combined files are sources.
Parameters:
Parameter | Type | Description |
---|---|---|
sourceFileNames | java.lang.String[] | The source file names. |
moveItem(FolderInfo folder, FolderInfo newFolder)
public final void moveItem(FolderInfo folder, FolderInfo newFolder)
Moves a specified folder to a new parent folder within the current pst.
Parameters:
Parameter | Type | Description |
---|---|---|
folder | FolderInfo | The folder to move. |
newFolder | FolderInfo | The new parent folder. |
moveItem(MessageInfo message, FolderInfo newFolder)
public final void moveItem(MessageInfo message, FolderInfo newFolder)
Moves a specified message to a new folder within the current pst.
Parameters:
Parameter | Type | Description |
---|---|---|
message | MessageInfo | The message to move. |
newFolder | FolderInfo | The new folder for the message. |
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
saveAs(OutputStream stream, int format)
public final void saveAs(OutputStream stream, int format)
Saves the current object to a specified file format in a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
stream | java.io.OutputStream | The stream to be saved. |
format | int | The FileFormat is to be used. |
It is used for the fast OST to PST conversion. The method doesn’t support conversion of OST created by MS Office 2013 and later versions. To convert an OST of later version, create a new PST and use the #mergeWith(Stream[]).mergeWith(Stream[]) method. |
saveAs(String fileName, int format)
public final void saveAs(String fileName, int format)
Saves the current object to a specified file format in a different file.
Parameters:
Parameter | Type | Description |
---|---|---|
fileName | java.lang.String | The name of the file to be saved. |
format | int | The FileFormat is to be used when saving a file. |
It is used for the fast OST to PST conversion. The method doesn’t support conversion of OST created by MS Office 2013 and later versions. To convert an OST of later version, create a new PST and use the #mergeWith(String[]).mergeWith(String[]) method. |
saveMessageToFile(String entryId, String fileName)
public void saveMessageToFile(String entryId, String fileName)
saveMessageToFile.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | a java.lang.String object. |
fileName | java.lang.String | a java.lang.String object. |
saveMessageToStream(String entryId, OutputStream stream)
public final void saveMessageToStream(String entryId, OutputStream stream)
Saves the message, with specified entryID, to a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The entry id. |
stream | java.io.OutputStream | The stream for writing. |
splitInto(System.Collections.Generic.IGenericList criteria, String path)
public final void splitInto(System.Collections.Generic.IGenericList<MailQuery> criteria, String path)
Splits the pst storage based on criteria.
Parameters:
Parameter | Type | Description |
---|---|---|
criteria | com.aspose.ms.System.Collections.Generic.IGenericList<com.aspose.email.MailQuery> | The collection of MailQuery that represents criteria of pst splitting. |
path | java.lang.String | The folder path where chunks will be created. |
splitInto(System.Collections.Generic.IGenericList criteria, String partFileNamePrefix, String path)
public final void splitInto(System.Collections.Generic.IGenericList<MailQuery> criteria, String partFileNamePrefix, String path)
Splits the pst storage based on criteria.
Parameters:
Parameter | Type | Description |
---|---|---|
criteria | com.aspose.ms.System.Collections.Generic.IGenericList<com.aspose.email.MailQuery> | The collection of MailQuery that represents criteria of pst splitting. |
partFileNamePrefix | java.lang.String | The prefix to be added to the filename of each part of pst. If provided, the prefix will be added to the beginning of each file name. If not provided (null or empty), the pst parts will be created without a prefix. The pst file names are produced using the following template: {prefix}_part{number}.pst - {prefix}: The filename prefix provided by the partFileNamePrefix parameter. If not provided, this part will be omitted. - {number}: The number of the chunk file. |
path | java.lang.String | The folder path where chunks will be created. |
splitInto(long chunkSize, String path)
public final void splitInto(long chunkSize, String path)
Splits the pst storage into less sized parts.
Parameters:
Parameter | Type | Description |
---|---|---|
chunkSize | long | The approximate size of a chunk in bytes. |
path | java.lang.String | The folder path where chunks will be created. |
splitInto(long chunkSize, String partFileNamePrefix, String path)
public final void splitInto(long chunkSize, String partFileNamePrefix, String path)
Splits the pst storage into less sized parts.
Parameters:
Parameter | Type | Description |
---|---|---|
chunkSize | long | The approximate size of a chunk in bytes. |
partFileNamePrefix | java.lang.String | The prefix to be added to the filename of each part of pst. If provided, the prefix will be added to the beginning of each file name. If not provided (null or empty), the pst parts will be created without a prefix. |
The pst file names are produced using the following template: {prefix}_part{number}.pst - {prefix}: The filename prefix provided by the partFileNamePrefix parameter. If not provided, this part will be omitted. - {number}: The number of the chunk file. | | path | java.lang.String | The folder path where chunks will be created. |
toString()
public String toString()
Returns: java.lang.String
tryToGetFolderById(String entryIdString, FolderInfo[] folder)
public final boolean tryToGetFolderById(String entryIdString, FolderInfo[] folder)
Gets the folder associated with the specified entry ID.
Parameters:
Parameter | Type | Description |
---|---|---|
entryIdString | java.lang.String | The string that represented the entry ID. |
folder | FolderInfo[] | When this method returns true, contains the FolderInfo object associated with the specified ID. |
Returns: boolean - true if the folder is successfully found; otherwise, false.
tryToSaveMessage(String entryId, OutputStream stream)
public final SaveResult tryToSaveMessage(String entryId, OutputStream stream)
Saves the message, with specified entryID, to a stream.
Parameters:
Parameter | Type | Description |
---|---|---|
entryId | java.lang.String | The entry id. |
stream | java.io.OutputStream | The stream for writing. |
Returns: SaveResult - The SaveResult that represents the result of item saving.
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |