Class EncryptedFileStore
IContentFileStore implementation that transparently encrypts file content.
Namespace: Tableau.Migration.Content.Files
Assembly: Tableau.Migration.dll
Syntax
public class EncryptedFileStore : IContentFileStore, IAsyncDisposable
Constructors
EncryptedFileStore(IServiceProvider, IContentFileStore)
Creates a new EncryptedFileStore object.
Declaration
public EncryptedFileStore(IServiceProvider services, IContentFileStore innerStore)
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | services | The service provider for DI services. |
IContentFileStore | innerStore | A file store to wrap with encryption. |
EncryptedFileStore(ISymmetricEncryptionFactory, IContentFileStore, IConfigReader, ILogger<EncryptedFileStore>, ISharedResourcesLocalizer)
Creates a new EncryptedFileStore object.
Declaration
public EncryptedFileStore(ISymmetricEncryptionFactory encryptionFactory, IContentFileStore innerStore, IConfigReader configReader, ILogger<EncryptedFileStore> logger, ISharedResourcesLocalizer localizer)
Parameters
Type | Name | Description |
---|---|---|
ISymmetricEncryptionFactory | encryptionFactory | An encryption factory. |
IContentFileStore | innerStore | A file store to wrap with encryption. |
IConfigReader | configReader | A configuration reader. |
ILogger<EncryptedFileStore> | logger | A logger. |
ISharedResourcesLocalizer | localizer | A string localizer. |
Properties
HasOpenTableauFileEditor
Indicates if the store has any Tableau File Editor Open.
Declaration
public bool HasOpenTableauFileEditor { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
CloseTableauFileEditorAsync(IContentFileHandle, CancellationToken)
Closes the current Tableau file format editor for the content file, if one is open. Changes will be flushed before closing.
Declaration
public Task CloseTableauFileEditorAsync(IContentFileHandle handle, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The handle to the file to close the editor for. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task | A task to await. |
Create(string, string)
Creates a file managed by the file store.
Declaration
public IContentFileHandle Create(string relativeStorePath, string originalFileName)
Parameters
Type | Name | Description |
---|---|---|
string | relativeStorePath | The relative path and file name to create a file for within the file store. |
string | originalFileName | The original file name external to the file store to preserve when publishing content items. |
Returns
Type | Description |
---|---|
IContentFileHandle | A handle to the newly created file. |
Create<TContent>(TContent, string)
Creates a file managed by the file store.
Declaration
public IContentFileHandle Create<TContent>(TContent contentItem, string originalFileName)
Parameters
Type | Name | Description |
---|---|---|
TContent | contentItem | The content item to resolve a relative file store path from. |
string | originalFileName | The original file name external to the file store to preserve when publishing content items. |
Returns
Type | Description |
---|---|
IContentFileHandle | A handle to the newly created file. |
Type Parameters
Name | Description |
---|---|
TContent | The content type. |
DeleteAsync(IContentFileHandle, CancellationToken)
Deletes a file managed by the file store.
Declaration
public Task DeleteAsync(IContentFileHandle handle, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The handle to the file to delete. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task | A task to await. |
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask | A task that represents the asynchronous dispose operation. |
GetTableauFileEditorAsync(IContentFileHandle, CancellationToken, bool?)
Gets the current Tableau file format editor for the content file, opening a new editor if necessary.
Declaration
public Task<ITableauFileEditor> GetTableauFileEditorAsync(IContentFileHandle handle, CancellationToken cancel, bool? zipFormatOverride = null)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The handle to the file to get the editor for. |
CancellationToken | cancel | The cancellation token to obey. |
bool? | zipFormatOverride | True to consider the file a zip archive, false to consider the file an XML file, or null to detect whether the file is a zip archive. |
Returns
Type | Description |
---|---|
Task<ITableauFileEditor> | The editor to use. Changes made will be flushed automatically before the content item is published. |
OpenReadAsync(IContentFileHandle, CancellationToken)
Opens a stream to read from a file.
Declaration
public Task<IContentFileStream> OpenReadAsync(IContentFileHandle handle, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The handle to the file to read from. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileStream> | The stream to read from. |
OpenWriteAsync(IContentFileHandle, CancellationToken)
Opens a stream to write to a file.
Declaration
public Task<IContentFileStream> OpenWriteAsync(IContentFileHandle handle, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The handle to the file to write to. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileStream> | The stream to write to. |