# EmailStorePstWriter

Incrementally creates a new dependency-free Unicode PST. Source PST/OST files are never modified.

Class 

`OfficeIMO.Email.Store`

**Namespace**

`OfficeIMO.Email.Store`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailStorePstWriter.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L24)

**Implements**

`IDisposable`

**Modifiers**

sealed

Incrementally creates a new dependency-free Unicode PST. Source PST/OST files are never modified.

## Inheritance

- object
- EmailStorePstWriter

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [EmailStorePstWriter.Create](/api/email/officeimo-email-store-emailstorepstwriter/#method-create-string-officeimo-email-store-emailstorepstwriteroptions)
- Method [EmailStorePstWriter.Resume](/api/email/officeimo-email-store-emailstorepstwriter/#method-resume-string-iprogress-officeimo-email-store-emailstorepstwriteprogress)

Filter members 

Show inherited

## Methods

`public void Abandon()` [#](#method-abandon)

[EmailStorePstWriter.cs:132](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L132)

Marks this incomplete writer for cleanup instead of checkpoint retention on disposal.

AddFolder 2 overloads

`public string AddFolder(string name, string? parentFolderId = null, string? containerClass = null)` [#](#method-addfolder-string-string-string)

[EmailStorePstWriter.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L96)

Adds a folder. A null parent places it under [EmailStorePstWriter.RootFolderId](/api/email/officeimo-email-store-emailstorepstwriter/).

Parameters

**name string required**

**parentFolderId string? = null optional**

**containerClass string? = null optional**

Returns

`string`

`public string AddFolder(string name, EmailStoreSpecialFolderKind specialFolderKind, string? parentFolderId = null, string? containerClass = null)` [#](#method-addfolder-string-officeimo-email-store-emailstorespecialfolderkind-string-string)

[EmailStorePstWriter.cs:104](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L104)

Adds a folder with a supported standard Outlook default-folder identity.

Parameters

**name string required**

**specialFolderKind OfficeIMO.Email.Store.EmailStoreSpecialFolderKind required**

**parentFolderId string? = null optional**

**containerClass string? = null optional**

Returns

`string`

`public string AddItem(string folderId, EmailDocument document, bool isAssociated = false, CancellationToken cancellationToken = default)` [#](#method-additem-string-officeimo-email-emaildocument-boolean-threading-cancellationtoken)

[EmailStorePstWriter.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L111)

Writes one message or typed Outlook item into a folder.

Parameters

**folderId string required**

**document OfficeIMO.Email.EmailDocument required**

**isAssociated bool = false optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`string`

`public static bool CanAssignSpecialFolderKind(EmailStoreSpecialFolderKind specialFolderKind)` [#](#method-canassignspecialfolderkind-officeimo-email-store-emailstorespecialfolderkind)

[EmailStorePstWriter.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L50)

Returns whether a user-created folder can receive this standard EntryID-backed role.

Parameters

**specialFolderKind OfficeIMO.Email.Store.EmailStoreSpecialFolderKind required**

Returns

`bool`

Checkpoint 2 overloads

`public void Checkpoint()` [#](#method-checkpoint)

[EmailStorePstWriter.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L118)

Flushes all working data and atomically commits a resumable integrity-checked checkpoint.

`public void Checkpoint(byte[]? applicationState)` [#](#method-checkpoint-byte)

[EmailStorePstWriter.cs:126](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L126)

Flushes writer data and atomically commits bounded caller state in the same integrity-checked checkpoint.

Parameters

**applicationState byte[]? required**

`public EmailStorePstWriteReport Complete(CancellationToken cancellationToken = default)` [#](#method-complete-threading-cancellationtoken)

[EmailStorePstWriter.cs:138](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L138)

Finalizes indexes and allocation maps, then atomically commits the PST.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`EmailStorePstWriteReport`

`public static EmailStorePstWriter Create(string destinationPath, EmailStorePstWriterOptions? options = null)` [#](#method-create-string-officeimo-email-store-emailstorepstwriteroptions)

[EmailStorePstWriter.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L24)

Creates a writer targeting a new PST path.

Parameters

**destinationPath string required**

**options OfficeIMO.Email.Store.EmailStorePstWriterOptions? = null optional**

Returns

`EmailStorePstWriter`

`public static void DeleteCheckpoint(string checkpointPath)` [#](#method-deletecheckpoint-string)

[EmailStorePstWriter.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L46)

Deletes a checkpoint and its exact writer-owned working files. A missing checkpoint is a no-op.

Parameters

**checkpointPath string required**

`public void Dispose()` [#](#method-dispose)

[EmailStorePstWriter.cs:146](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L146)

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

Resume 2 overloads

`public static EmailStorePstWriter Resume(string checkpointPath, IProgress<EmailStorePstWriteProgress>? progress = null)` [#](#method-resume-string-iprogress-officeimo-email-store-emailstorepstwriteprogress)

[EmailStorePstWriter.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L31)

Resumes a writer from its last integrity-checked durable checkpoint.

Parameters

**checkpointPath string required**

**progress System.IProgress<OfficeIMO.Email.Store.EmailStorePstWriteProgress>? = null optional**

Returns

`EmailStorePstWriter`

`public static EmailStorePstWriter Resume(string checkpointPath, out byte[]? applicationState, IProgress<EmailStorePstWriteProgress>? progress = null)` [#](#method-resume-string-byte-iprogress-officeimo-email-store-emailstorepstwriteprogress)

[EmailStorePstWriter.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L37)

Resumes a writer and returns caller state committed atomically with the writer checkpoint.

Parameters

**checkpointPath string required**

**applicationState byte[]? required**

**progress System.IProgress<OfficeIMO.Email.Store.EmailStorePstWriteProgress>? = null optional**

Returns

`EmailStorePstWriter`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string? CheckpointPath { get; }` [#](#property-checkpointpath)

[EmailStorePstWriter.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L54)

Configured durable checkpoint path, or null when resumability is disabled.

`public string RootFolderId { get; }` [#](#property-rootfolderid)

[EmailStorePstWriter.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Writing/EmailStorePstWriter.cs#L59)

Identifier of the mandatory Top of Personal Folders container.

<!-- PowerForge markdown artifact sha256:BC6BF5AD2AC4E9D3D4AB1F211FB159A0A58FD54739B9AB5FC8A7EF555B38F6D6 -->
