Interface IContentFileStore
Interface for an object that can store and manage files for content items.
Inherited Members
Namespace: Tableau.Migration.Content.Files
Assembly: Tableau.Migration.dll
Syntax
public interface IContentFileStore : IAsyncDisposable
Properties
HasOpenTableauFileEditor
Indicates if the store has any Tableau File Editor Open.
Declaration
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
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
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. |
CreateAsync(string, string, Stream, CancellationToken)
Creates a file managed by the file store.
Declaration
Task<IContentFileHandle> CreateAsync(string relativeStorePath, string originalFileName, Stream initialContent, CancellationToken cancel)
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. |
Stream | initialContent | The initial content to save the file with. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileHandle> | A handle to the newly created file. |
CreateAsync<TContent>(TContent, string, Stream, CancellationToken)
Creates a file managed by the file store.
Declaration
Task<IContentFileHandle> CreateAsync<TContent>(TContent contentItem, string originalFileName, Stream initialContent, CancellationToken cancel)
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. |
Stream | initialContent | The initial content to save the file with. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileHandle> | A handle to the newly created file. |
Type Parameters
Name | Description |
---|---|
TContent | The content type. |
Create<TContent>(TContent, string)
Creates a file managed by the file store.
Declaration
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
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. |
GetTableauFileEditorAsync(IContentFileHandle, CancellationToken, bool?)
Gets the current Tableau file format editor for the content file, opening a new editor if necessary.
Declaration
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
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
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. |