Class FileProcessingContext
Represents the context for processing a file, providing access to the source file or stream and methods to create new work files or directories.
Implements
Namespace: FulcrumFS
Assembly: FulcrumFS.dll
Syntax
public sealed class FileProcessingContext : IAsyncDisposable
Properties
| Name | Description |
|---|---|
| CancellationToken | Gets the cancellation token that can be used to observe cancellation requests. |
| Extension | Gets the file extension of the source, including the leading dot (e.g., ".jpg", ".png"), otherwise an empty string. File extensions are always lowercase. |
| FileId | Gets the file ID that is being processed in the pipeline. |
| HasChanges | Gets a value indicating whether the source has had any changes made to it during processing. |
| IsLastProcessStep | Gets a value indicating whether the pipeline is at the last process step. |
| ProgressCallback | Gets a value that represents the callback function to report the progress of the file processing operation. The callback function takes a double value representing the progress fraction (between 0.0 and 1.0) and returns a ValueTask to await. |
| ProgressDisplayMessageCallback | Gets a value that represents the callback function to report an optional informative display message for the current processing stage. |
| VariantId | Gets the variant ID of the file being processed in the pipeline, or null if the file is not a variant. |
Methods
| Name | Description |
|---|---|
| DisposeAsync() | Asynchronously releases the resources used by the instance, including disposing the source (if owned) and deleting the temporary working directory. |
| GetNewWorkDirectory() | Gets a new non-existent directory path that can be used for any intermediate work required by a FileProcessor or to store the final result. |
| GetNewWorkFile(string) | Gets a new non-existent file path that can be used for any intermediate work required by a FileProcessor or to store the final result. |
| GetSourceAsFileAsync() | Gets the source as an IAbsoluteFilePath. |
| GetSourceAsSeekableStreamAsync(bool, long) | Gets the source as a seekable Stream. |
| IsTempWorkingFile(IAbsoluteFilePath) | Gets a value indicating whether the specified file is located within the temporary working directory for this processing context. |