Represents Personal Storage Table (.pst) file. More...

Inherits IDisposable.

Public Member Functions

System::SharedPtr< FolderInfoget_RootFolder () const
 Gets the root folder of PST. More...
 
System::SharedPtr< MessageStoreget_Store () const
 Gets the PST message store. More...
 
FileFormat get_Format ()
 Gets the file format. More...
 
bool get_CanWrite ()
 Gets a value indicating whether the current pst supports writing. More...
 
bool get_IsUnicode ()
 Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI. More...
 
 PersonalStorage (Aspose::Email::Exceptions::TraversalExceptionsCallback callback)
 Initializes a new instance of the PersonalStorage class. Allows setting a callback method for handling exceptions that occur during PST traversal. More...
 
bool Load (System::String fileName)
 Load PST from file. This method is used when a PersonalStorage object is created using the constructor. More...
 
bool Load (System::SharedPtr< System::IO::Stream > stream)
 Load PST from stream. This method is used when a PersonalStorage object is created using the constructor. More...
 
VentureLicenseState GetVentureLicenseState ()
 
void SaveAs (System::String fileName, FileFormat format)
 Saves the current object to a specified file format in a different file. More...
 
void SaveAs (System::SharedPtr< System::IO::Stream > stream, FileFormat format)
 Saves the current object to a specified file format in a stream. More...
 
void ConvertTo (FileFormat format)
 Converts the current object to the specified format. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiPropertyExtractProperty (System::ArrayPtr< uint8_t > entryId, int64_t tag)
 Gets the specified property of item, without extract the item fully. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiMessageExtractMessage (System::SharedPtr< MessageInfo > messageInfo)
 Get the message from PST. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiMessageExtractMessage (System::ArrayPtr< uint8_t > entryId)
 Get the message from PST. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiMessageExtractMessage (System::String entryId)
 Get the message from PST. More...
 
void DeleteItem (System::String entryId)
 Deletes the item (folder or message) by it's entryId More...
 
void SaveMessageToStream (System::String entryId, System::SharedPtr< System::IO::Stream > stream)
 Saves the message, with specified entryID, to a stream. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MessageInfo > > > EnumerateMessages (System::String entryId)
 Exposes the enumerator, which supports an iteration of messages in folder. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< MessageInfo > > > EnumerateMessages (System::String entryId, int32_t startIndex, int32_t count)
 Exposes the enumerator, which supports an iteration of messages in folder. More...
 
System::SharedPtr< SaveResultTryToSaveMessage (System::String entryId, System::SharedPtr< System::IO::Stream > stream)
 Saves the message, with specified entryID, to a stream. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiAttachmentCollectionExtractAttachments (System::SharedPtr< MessageInfo > messageInfo)
 Extracts the attachments. More...
 
System::SharedPtr< Aspose::Email::Mapi::MapiAttachmentCollectionExtractAttachments (System::String entryId)
 Extracts the attachments. More...
 
System::SharedPtr< FolderInfoGetFolderById (System::ArrayPtr< uint8_t > entryId)
 Gets the personal folder from PST. More...
 
bool TryToGetFolderById (System::String entryIdString, System::SharedPtr< FolderInfo > &folder)
 Gets the folder associated with the specified entry ID. More...
 
System::SharedPtr< FolderInfoGetFolderById (System::String entryIdString)
 Gets the personal folder from PST. More...
 
System::SharedPtr< System::Collections::Generic::IList< System::String > > FindSubfolders (System::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. More...
 
System::SharedPtr< System::Collections::Generic::IList< System::String > > FindMessages (System::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. More...
 
System::SharedPtr< FolderInfoGetParentFolder (System::String entryIdString)
 Gets the parent folder of message. More...
 
System::SharedPtr< FolderInfoGetParentFolder (System::ArrayPtr< uint8_t > entryId)
 Gets the parent folder of message. More...
 
System::SharedPtr< FolderInfoGetPredefinedFolder (StandardIpmFolder 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. More...
 
System::SharedPtr< FolderInfoCreatePredefinedFolder (System::String name, StandardIpmFolder defaultFolder, bool createHierarchy)
 Creates the standard interpersonal message (IPM) folder. More...
 
System::SharedPtr< FolderInfoCreatePredefinedFolder (System::String name, StandardIpmFolder defaultFolder)
 Creates the standard interpersonal message (IPM) folder. More...
 
void MoveItem (System::SharedPtr< MessageInfo > message, System::SharedPtr< FolderInfo > newFolder)
 Moves a specified message to a new folder within the current pst. More...
 
void MoveItem (System::SharedPtr< FolderInfo > folder, System::SharedPtr< FolderInfo > newFolder)
 Moves a specified folder to a new parent folder within the current pst. More...
 
void MergeWith (System::ArrayPtr< System::String > sourceFileNames)
 Merges the pst storage with one or more other pst files. Thus, the combined files are sources. More...
 
void MergeWith (System::ArrayPtr< System::SharedPtr< System::IO::Stream >> sourceStreams)
 Merges the pst storage with one or more other pst streams. Thus, the combined stream are sources. More...
 
void SplitInto (int64_t chunkSize, System::String path)
 Splits the pst storage into less sized parts. More...
 
void SplitInto (System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>> criteria, System::String path)
 Splits the pst storage based on criteria. More...
 
void SplitInto (int64_t chunkSize, System::String partFileNamePrefix, System::String path)
 Splits the pst storage into less sized parts. More...
 
void SplitInto (System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>> criteria, System::String partFileNamePrefix, System::String path)
 Splits the pst storage based on criteria. More...
 
void ChangeMessage (System::String entryId, System::SharedPtr< Aspose::Email::Mapi::MapiPropertyCollection > updatedProperties)
 Changes the message properties. More...
 
System::SharedPtr< PersonalStorageCreateFolderMapping (System::SharedPtr< System::Collections::Generic::Dictionary< uint32_t, uint32_t >> table)
 Clones the folder structure. More...
 
System::SharedPtr< PersonalStorageCloneFolderStructure (System::String fileName, System::SharedPtr< System::Collections::Generic::Dictionary< uint32_t, uint32_t >> table)
 Clones the folder structure. More...
 
void OnStorageProcessed (System::SharedPtr< StorageProcessedEventArgs > e)
 Raises the E:ChunkCreated event. More...
 
void Dispose () override
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 

Static Public Member Functions

static System::SharedPtr< PersonalStorageFromFile (System::String fileName)
 Load PST from file. More...
 
static System::SharedPtr< PersonalStorageFromFile (System::String fileName, bool writable)
 Load PST from file. More...
 
static System::SharedPtr< PersonalStorageFromFile (System::String fileName, System::SharedPtr< PersonalStorageLoadOptions > loadOptions)
 Load PST from file. More...
 
static System::SharedPtr< PersonalStorageFromStream (System::SharedPtr< System::IO::Stream > stream, bool writable)
 Load PST from stream. More...
 
static System::SharedPtr< PersonalStorageFromStream (System::SharedPtr< System::IO::Stream > stream, System::SharedPtr< PersonalStorageLoadOptions > loadOptions)
 Load PST from stream. More...
 
static System::SharedPtr< PersonalStorageFromStream (System::SharedPtr< System::IO::Stream > stream)
 Load PST from stream. More...
 
static System::SharedPtr< PersonalStorageCreate (System::String fileName, FileFormatVersion version)
 Creates the new PST file with the specified file name. More...
 
static System::SharedPtr< PersonalStorageCreate (System::SharedPtr< System::IO::Stream > stream, FileFormatVersion version)
 Creates the PST in a stream. More...
 
static System::SharedPtr< PersonalStorageCreate (System::SharedPtr< System::IO::Stream > stream, FileFormatVersion version, bool leaveStreamOpen)
 Creates the PST in a stream. More...
 

Public Attributes

System::SharedPtr< PstDoer > pstDoer
 The pst reader. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< ItemMovedEventArgs >)> ItemMoved
 Occurs when an item is moved to the another folder. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< StorageProcessedEventArgs >)> 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. More...
 
System::Event< void(System::SharedPtr< System::Object >, System::SharedPtr< StorageProcessingEventArgs >)> StorageProcessing
 Occurs before the srorage is processed. The event is raised before processing the next storage in merging or splitting operations. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources. More...
 
virtual ~PersonalStorage ()
 

Friends

class Aspose::Email::Storage::Pst::ChunkInfo
 

Detailed Description

Represents Personal Storage Table (.pst) file.

Constructor & Destructor Documentation

◆ PersonalStorage()

Aspose::Email::Storage::Pst::PersonalStorage::PersonalStorage ( Aspose::Email::Exceptions::TraversalExceptionsCallback  callback)

Initializes a new instance of the PersonalStorage class. Allows setting a callback method for handling exceptions that occur during PST traversal.

Parameters
callbackThe exception callback.

◆ ~PersonalStorage()

virtual Aspose::Email::Storage::Pst::PersonalStorage::~PersonalStorage ( )
protectedvirtual

Member Function Documentation

◆ ChangeMessage()

void Aspose::Email::Storage::Pst::PersonalStorage::ChangeMessage ( System::String  entryId,
System::SharedPtr< Aspose::Email::Mapi::MapiPropertyCollection updatedProperties 
)

Changes the message properties.

Parameters
entryIdThe entry identifier of message.
updatedPropertiesThe updated properties.
Exceptions
System::NotImplementedExceptionThe ANSI file version editing is not implemented.
System::InvalidOperationExceptionThe PST is open for reading only. or The entryId is incorrect.
System::ArgumentNullExceptionentryIdCollection;The collection of entry ids cannot be null. or updatedProperties;The collection of properties cannot be null.

◆ CloneFolderStructure()

System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::CloneFolderStructure ( System::String  fileName,
System::SharedPtr< System::Collections::Generic::Dictionary< uint32_t, uint32_t >>  table 
)

Clones the folder structure.

Returns
Personal storage.

◆ ConvertTo()

void Aspose::Email::Storage::Pst::PersonalStorage::ConvertTo ( FileFormat  format)

Converts the current object to the specified format.

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[]) method.

Parameters
formatThe FileFormat to convert the current object to.

◆ Create() [1/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::Create ( System::SharedPtr< System::IO::Stream >  stream,
FileFormatVersion  version 
)
static

Creates the PST in a stream.

Note, only Unicode file version creation is supported now.

Parameters
streamThe stream in which PST is created.
versionThe PST file version.
Returns
A PersonalStorage object that represents the new PST.
Exceptions
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if stream is null

◆ Create() [2/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::Create ( System::SharedPtr< System::IO::Stream >  stream,
FileFormatVersion  version,
bool  leaveStreamOpen 
)
static

Creates the PST in a stream.

Note, only Unicode file version creation is supported now.

Parameters
streamThe stream in which PST is created.
versionThe PST file version.
leaveStreamOpenLeave stream open when PersonalStorage is disposed.
Returns
A PersonalStorage object that represents the new PST.
Exceptions
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if stream is null

◆ Create() [3/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::Create ( System::String  fileName,
FileFormatVersion  version 
)
static

Creates the new PST file with the specified file name.

Note, only Unicode file version creation is supported now.

Parameters
fileNameThe full name of the file.
versionThe PST file version.
Returns
A PersonalStorage object that represents the new PST.
Exceptions
NotImplementedExceptionthrows if ANSI file version is created
ArgumentNullExceptionthrows if file name is null or empty

◆ CreateFolderMapping()

System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::CreateFolderMapping ( System::SharedPtr< System::Collections::Generic::Dictionary< uint32_t, uint32_t >>  table)

Clones the folder structure.

Returns
Personal storage.

◆ CreatePredefinedFolder() [1/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::CreatePredefinedFolder ( System::String  name,
StandardIpmFolder  defaultFolder 
)

Creates the standard interpersonal message (IPM) folder.

Parameters
nameThe name of folder.
defaultFolderThe value of StandardIpmFolder enumeration.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ CreatePredefinedFolder() [2/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::CreatePredefinedFolder ( System::String  name,
StandardIpmFolder  defaultFolder,
bool  createHierarchy 
)

Creates the standard interpersonal message (IPM) folder.

Parameters
nameThe name of folder.
defaultFolderThe value of StandardIpmFolder enumeration.
createHierarchyif set to true, it is possible to create a folder hierarchy using string notation. Backslash ('\') is used as path separator.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ DeleteItem()

void Aspose::Email::Storage::Pst::PersonalStorage::DeleteItem ( System::String  entryId)

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

Parameters
entryId

◆ Dispose() [1/2]

void Aspose::Email::Storage::Pst::PersonalStorage::Dispose ( )
override

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ Dispose() [2/2]

virtual void Aspose::Email::Storage::Pst::PersonalStorage::Dispose ( bool  disposing)
protectedvirtual

Releases unmanaged and - optionally - managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

◆ EnumerateMessages() [1/2]

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MessageInfo> > > Aspose::Email::Storage::Pst::PersonalStorage::EnumerateMessages ( System::String  entryId)

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

Parameters
entryIdThe string that represents a parent folder entry ID.
Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in folder.

◆ EnumerateMessages() [2/2]

System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<MessageInfo> > > Aspose::Email::Storage::Pst::PersonalStorage::EnumerateMessages ( System::String  entryId,
int32_t  startIndex,
int32_t  count 
)

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

Parameters
entryIdThe string that represents a parent folder entry ID.
startIndexThe start message index.
countThe number of messages that will be retrieved.
Returns
System::Collections::Generic::IEnumerable<T>, that represents an enumerator that iterates through a messages in folder.

◆ ExtractAttachments() [1/2]

System::SharedPtr<Aspose::Email::Mapi::MapiAttachmentCollection> Aspose::Email::Storage::Pst::PersonalStorage::ExtractAttachments ( System::SharedPtr< MessageInfo messageInfo)

Extracts the attachments.

Parameters
messageInfoThe message information.
Returns
The MapiAttachmentCollection that represents the collection of attachments.

◆ ExtractAttachments() [2/2]

System::SharedPtr<Aspose::Email::Mapi::MapiAttachmentCollection> Aspose::Email::Storage::Pst::PersonalStorage::ExtractAttachments ( System::String  entryId)

Extracts the attachments.

Parameters
entryIdThe message entryId.
Returns
The MapiAttachmentCollection that represents the collection of attachments.

◆ ExtractMessage() [1/3]

System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::ArrayPtr< uint8_t >  entryId)

Get the message from PST.

Parameters
entryIdEntryId of message.
Returns
A MapiMessage object.

◆ ExtractMessage() [2/3]

System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::SharedPtr< MessageInfo messageInfo)

Get the message from PST.

Parameters
messageInfoA MessageInfo object that represents information about message.
Returns
A MapiMessage object.

◆ ExtractMessage() [3/3]

System::SharedPtr<Aspose::Email::Mapi::MapiMessage> Aspose::Email::Storage::Pst::PersonalStorage::ExtractMessage ( System::String  entryId)

Get the message from PST.

Parameters
entryIdString representation of EntryId.
Returns
A MapiMessage object.

◆ ExtractProperty()

System::SharedPtr<Aspose::Email::Mapi::MapiProperty> Aspose::Email::Storage::Pst::PersonalStorage::ExtractProperty ( System::ArrayPtr< uint8_t >  entryId,
int64_t  tag 
)

Gets the specified property of item, without extract the item fully.

If a property is not found, null is returned.

Parameters
entryIdThe entry id of item.
tagThe property tag.
Returns
The MapiProperty.

◆ FindMessages()

System::SharedPtr<System::Collections::Generic::IList<System::String> > Aspose::Email::Storage::Pst::PersonalStorage::FindMessages ( System::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
parentEntryIdEntry id of the parent folder.
Returns
Collection of entry Ids.

◆ FindSubfolders()

System::SharedPtr<System::Collections::Generic::IList<System::String> > Aspose::Email::Storage::Pst::PersonalStorage::FindSubfolders ( System::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
parentEntryIdEntry id of the parent folder.
Returns
Collection of entry Ids.

◆ FromFile() [1/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromFile ( System::String  fileName)
static

Load PST from file.

Parameters
fileNameName of .pst file.
Returns
A PersonalStorage object that represents the current PST.

By default, the pst will support writing.

◆ FromFile() [2/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromFile ( System::String  fileName,
bool  writable 
)
static

Load PST from file.

Parameters
fileNameName of .pst file.
writableif set to true then the the pst file will support writing, otherwise it will be opened in read-only mode.
Returns
A PersonalStorage object that represents the current PST.

◆ FromFile() [3/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromFile ( System::String  fileName,
System::SharedPtr< PersonalStorageLoadOptions loadOptions 
)
static

Load PST from file.

Parameters
fileNameName of .pst file.
loadOptionsThe load options.
Returns
A PersonalStorage object that represents the current PST.
Exceptions
ArgumentNullExceptionfileName - File name can not be null or empty
ArgumentExceptionPersonalStorageLoadOptions.LeaveStreamOpen can not be true.

◆ FromStream() [1/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream)
static

Load PST from stream.

Parameters
streamThe System.IO.Stream.
Returns
A PersonalStorage object that represents the current PST.

By default, the pst will support writing.

◆ FromStream() [2/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream,
bool  writable 
)
static

Load PST from stream.

Parameters
streamThe System.IO.Stream.
writableif set to true then the the pst will support writing, otherwise it will be opened in read-only mode.
Returns
A PersonalStorage object that represents the current PST.

◆ FromStream() [3/3]

static System::SharedPtr<PersonalStorage> Aspose::Email::Storage::Pst::PersonalStorage::FromStream ( System::SharedPtr< System::IO::Stream >  stream,
System::SharedPtr< PersonalStorageLoadOptions loadOptions 
)
static

Load PST from stream.

Parameters
streamThe System.IO.Stream.
loadOptionsThe load options.
Returns
A PersonalStorage object that represents the current PST.

◆ get_CanWrite()

bool Aspose::Email::Storage::Pst::PersonalStorage::get_CanWrite ( )

Gets a value indicating whether the current pst supports writing.

◆ get_Format()

FileFormat Aspose::Email::Storage::Pst::PersonalStorage::get_Format ( )

Gets the file format.

FileFormat that specifies file format.

The .pst and .ost file formats are supported now.

◆ get_IsUnicode()

bool Aspose::Email::Storage::Pst::PersonalStorage::get_IsUnicode ( )

Gets a value indicating whether the PST file format is Unicode. There are two versions of the PST file format: Unicode and ANSI.

◆ get_RootFolder()

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::get_RootFolder ( ) const

Gets the root folder of PST.

FolderInfo that represents a root folder.

◆ get_Store()

System::SharedPtr<MessageStore> Aspose::Email::Storage::Pst::PersonalStorage::get_Store ( ) const

Gets the PST message store.

The MessageStore which is the rough equivalent of the top of a Mailbox.

◆ GetFolderById() [1/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetFolderById ( System::ArrayPtr< uint8_t >  entryId)

Gets the personal folder from PST.

Parameters
entryIdThe Entry id.
Returns
A FolderInfo object.

◆ GetFolderById() [2/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetFolderById ( System::String  entryIdString)

Gets the personal folder from PST.

Parameters
entryIdStringString representation of entry ID.
Returns
A FolderInfo object.

◆ GetParentFolder() [1/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetParentFolder ( System::ArrayPtr< uint8_t >  entryId)

Gets the parent folder of message.

Parameters
entryIdEntry Id of message or folder.
Returns
The parent folderFolderInfo of message.

◆ GetParentFolder() [2/2]

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetParentFolder ( System::String  entryIdString)

Gets the parent folder of message.

Parameters
entryIdStringString representation of Entry Id of message or folder.
Returns
The parent folderFolderInfo of message.

◆ GetPredefinedFolder()

System::SharedPtr<FolderInfo> Aspose::Email::Storage::Pst::PersonalStorage::GetPredefinedFolder ( StandardIpmFolder  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
defaultFolderThe value of StandardIpmFolder enumeration.
Returns
A FolderInfo object that represents a standard IPM folder.

◆ GetVentureLicenseState()

VentureLicenseState Aspose::Email::Storage::Pst::PersonalStorage::GetVentureLicenseState ( )

◆ Load() [1/2]

bool Aspose::Email::Storage::Pst::PersonalStorage::Load ( System::SharedPtr< System::IO::Stream >  stream)

Load PST from stream. This method is used when a PersonalStorage object is created using the constructor.

Parameters
streamThe System.IO.Stream.
Returns
'true' if the file has been loaded successfully and further traversal is possible; otherwise, false.

◆ Load() [2/2]

bool Aspose::Email::Storage::Pst::PersonalStorage::Load ( System::String  fileName)

Load PST from file. This method is used when a PersonalStorage object is created using the constructor.

Parameters
fileNameThe name of .pst file.
Exceptions
ArgumentNullExceptionfileName - File name can not be null or empty
Returns
'true' if the file has been loaded successfully and further traversal is possible; otherwise, false.

◆ MergeWith() [1/2]

void Aspose::Email::Storage::Pst::PersonalStorage::MergeWith ( System::ArrayPtr< System::SharedPtr< System::IO::Stream >>  sourceStreams)

Merges the pst storage with one or more other pst streams. Thus, the combined stream are sources.

Parameters
sourceStreamsThe source streams.
Exceptions
ArgumentNullException"Throws when the stream collection is null."
ArgumentException"Throws when the stream in collection is null."

◆ MergeWith() [2/2]

void Aspose::Email::Storage::Pst::PersonalStorage::MergeWith ( System::ArrayPtr< System::String >  sourceFileNames)

Merges the pst storage with one or more other pst files. Thus, the combined files are sources.

Parameters
sourceFileNamesThe source file names.
Exceptions
ArgumentNullException"Throws when the filename collection is null."
ArgumentException"Throws when the filename in collection is null or empty."

◆ MoveItem() [1/2]

void Aspose::Email::Storage::Pst::PersonalStorage::MoveItem ( System::SharedPtr< FolderInfo folder,
System::SharedPtr< FolderInfo newFolder 
)

Moves a specified folder to a new parent folder within the current pst.

Parameters
folderThe folder to move.
newFolderThe new parent folder.

◆ MoveItem() [2/2]

void Aspose::Email::Storage::Pst::PersonalStorage::MoveItem ( System::SharedPtr< MessageInfo message,
System::SharedPtr< FolderInfo newFolder 
)

Moves a specified message to a new folder within the current pst.

Parameters
messageThe message to move.
newFolderThe new folder for the message.

◆ OnStorageProcessed()

void Aspose::Email::Storage::Pst::PersonalStorage::OnStorageProcessed ( System::SharedPtr< StorageProcessedEventArgs e)

Raises the E:ChunkCreated event.

Parameters
eThe StorageProcessedEventArgs instance containing the event data.

◆ SaveAs() [1/2]

void Aspose::Email::Storage::Pst::PersonalStorage::SaveAs ( System::SharedPtr< System::IO::Stream >  stream,
FileFormat  format 
)

Saves the current object to a specified file format in a stream.

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[]) method.

Parameters
streamThe stream to be saved.
formatThe FileFormat is to be used.

◆ SaveAs() [2/2]

void Aspose::Email::Storage::Pst::PersonalStorage::SaveAs ( System::String  fileName,
FileFormat  format 
)

Saves the current object to a specified file format in a different 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[]) method.

Parameters
fileNameThe name of the file to be saved.
formatThe FileFormat is to be used when saving a file.

◆ SaveMessageToStream()

void Aspose::Email::Storage::Pst::PersonalStorage::SaveMessageToStream ( System::String  entryId,
System::SharedPtr< System::IO::Stream >  stream 
)

Saves the message, with specified entryID, to a stream.

Parameters
entryIdThe entry id.
streamThe stream for writing.

◆ SplitInto() [1/4]

void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( int64_t  chunkSize,
System::String  partFileNamePrefix,
System::String  path 
)

Splits the pst storage into less sized parts.

Parameters
chunkSizeThe approximate size of a chunk in bytes.
pathThe folder path where chunks will be created.
partFileNamePrefixThe 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.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.
ArgumentExceptionThrows when the chunk size is less then the minimum size of pst file.

◆ SplitInto() [2/4]

void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( int64_t  chunkSize,
System::String  path 
)

Splits the pst storage into less sized parts.

Parameters
chunkSizeThe approximate size of a chunk in bytes.
pathThe folder path where chunks will be created.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.
ArgumentExceptionThrows when the chunk size is less then the minimum size of pst file.

◆ SplitInto() [3/4]

void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>>  criteria,
System::String  partFileNamePrefix,
System::String  path 
)

Splits the pst storage based on criteria.

Parameters
criteriaThe collection of MailQuery that represents criteria of pst splitting.
pathThe folder path where chunks will be created.

///

Parameters
partFileNamePrefixThe 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.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.

◆ SplitInto() [4/4]

void Aspose::Email::Storage::Pst::PersonalStorage::SplitInto ( System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Email::Tools::Search::MailQuery >>>  criteria,
System::String  path 
)

Splits the pst storage based on criteria.

Parameters
criteriaThe collection of MailQuery that represents criteria of pst splitting.
pathThe folder path where chunks will be created.
Exceptions
ArgumentExceptionThrows when the path parameter is null or empty.

◆ TryToGetFolderById()

bool Aspose::Email::Storage::Pst::PersonalStorage::TryToGetFolderById ( System::String  entryIdString,
System::SharedPtr< FolderInfo > &  folder 
)

Gets the folder associated with the specified entry ID.

Parameters
entryIdStringThe string that represented the entry ID.
folderWhen this method returns true, contains the FolderInfo object associated with the specified ID.
Returns
true if the folder is successfully found; otherwise, false.

◆ TryToSaveMessage()

System::SharedPtr<SaveResult> Aspose::Email::Storage::Pst::PersonalStorage::TryToSaveMessage ( System::String  entryId,
System::SharedPtr< System::IO::Stream >  stream 
)

Saves the message, with specified entryID, to a stream.

Parameters
entryIdThe entry id.
streamThe stream for writing.
Returns
The SaveResult that represents the result of item saving.

Friends And Related Function Documentation

◆ Aspose::Email::Storage::Pst::ChunkInfo

friend class Aspose::Email::Storage::Pst::ChunkInfo
friend

Member Data Documentation

◆ ItemMoved

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<ItemMovedEventArgs>)> Aspose::Email::Storage::Pst::PersonalStorage::ItemMoved

Occurs when an item is moved to the another folder.

◆ pstDoer

System::SharedPtr<PstDoer> Aspose::Email::Storage::Pst::PersonalStorage::pstDoer

The pst reader.

◆ StorageProcessed

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<StorageProcessedEventArgs>)> Aspose::Email::Storage::Pst::PersonalStorage::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

System::Event<void(System::SharedPtr<System::Object>, System::SharedPtr<StorageProcessingEventArgs>)> Aspose::Email::Storage::Pst::PersonalStorage::StorageProcessing

Occurs before the srorage is processed. The event is raised before processing the next storage in merging or splitting operations.