Class ContentFileHandle
Interface describing a logical file that is part of a content item.
Namespace: Tableau.Migration.Content.Files
Assembly: Tableau.Migration.dll
Syntax
public record ContentFileHandle : IContentFileHandle, IAsyncDisposable, IEquatable<ContentFileHandle>
Constructors
ContentFileHandle(IContentFileStore, string, string)
Interface describing a logical file that is part of a content item.
Declaration
public ContentFileHandle(IContentFileStore Store, string Path, string OriginalFileName)
Parameters
Type | Name | Description |
---|---|---|
IContentFileStore | Store | The file store the handle is for. |
string | Path | The path to the file. |
string | OriginalFileName | The original filename of the file, used for the upload filename when publishing the content item. |
Properties
OriginalFileName
The original filename of the file, used for the upload filename when publishing the content item.
Declaration
public string OriginalFileName { get; init; }
Property Value
Type | Description |
---|---|
string |
Path
The path to the file.
Declaration
public string Path { get; init; }
Property Value
Type | Description |
---|---|
string |
Store
The file store the handle is for.
Declaration
public IContentFileStore Store { get; init; }
Property Value
Type | Description |
---|---|
IContentFileStore |
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Declaration
public virtual ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask | A task that represents the asynchronous dispose operation. |
GetXmlStreamAsync(CancellationToken)
Gets the current read/write stream to the XML content of the Tableau file, opening a new stream if necessary. Changes to the stream will be automatically saved before publishing.
Declaration
public virtual Task<ITableauFileXmlStream> GetXmlStreamAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<ITableauFileXmlStream> | The XML stream to edit. |
OpenReadAsync(CancellationToken)
Opens a stream to read from a file.
Declaration
public virtual Task<IContentFileStream> OpenReadAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileStream> | The stream to read from. |
OpenWriteAsync(CancellationToken)
Opens a stream to write to a file.
Declaration
public virtual Task<IContentFileStream> OpenWriteAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IContentFileStream> | The stream to write to. |