IVfsMethods
Namespace: MJCZone.MediaMatic.Interfaces
Assembly: MJCZone.MediaMatic
Summary
Defines methods for interacting with a virtual file system.
abstract public
Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.
Contents
Methods (14) | Properties (4)
Methods
| Method | Summary |
|---|---|
| UploadFileAsync | Uploads a file to the virtual file system. |
| UploadImageAsync | Uploads and processes an image. |
| UploadVideoAsync | Uploads and processes a video. |
| DownloadAsync | Downloads a file from the virtual file system. |
| ExistsAsync | Checks if a file exists. |
| ListFilesAsync | Lists files in a directory. |
| ListFoldersAsync | Lists directories in a directory. |
| DeleteAsync | Deletes a file. |
| DeleteFolderAsync | Deletes a folder and all its contents. |
| CreateFolderAsync | Creates a folder. |
| ProcessImageAsync | Processes an existing image. |
| GenerateThumbnailsAsync | Generates thumbnails from a video. |
| TranscodeVideoAsync | Transcodes a video to a different format. |
| GetMetadataAsync | Extracts metadata from a media file. |
UploadFileAsync
Uploads a file to the virtual file system.
Task<string> UploadFileAsync(
IVfsConnection vfs,
Stream stream,
string path,
bool overwrite,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- stream (Stream) - The file stream to upload.
- path (string) - The target path.
- overwrite (bool) - Whether to overwrite existing files.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<string>
The path to the uploaded file.
UploadImageAsync
Uploads and processes an image.
Task<ImageUploadResult> UploadImageAsync(
IVfsConnection vfs,
Stream stream,
string path,
ImageUploadOptions options,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- stream (Stream) - The image stream to upload.
- path (string) - The target path.
- options (ImageUploadOptions) - Image upload options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<ImageUploadResult>
The upload result including generated variants.
UploadVideoAsync
Uploads and processes a video.
Task<VideoUploadResult> UploadVideoAsync(
IVfsConnection vfs,
Stream stream,
string path,
VideoUploadOptions options,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- stream (Stream) - The video stream to upload.
- path (string) - The target path.
- options (VideoUploadOptions) - Video upload options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<VideoUploadResult>
The upload result including thumbnails and metadata.
DownloadAsync
Downloads a file from the virtual file system.
Task<Stream> DownloadAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The file path to download.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<Stream>
A stream containing the file data.
ExistsAsync
Checks if a file exists.
Task<bool> ExistsAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The file path to check.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<bool>
True if the file exists.
ListFilesAsync
Lists files in a directory.
Task<IEnumerable<string>> ListFilesAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The directory path (null for root).
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<string>>
List of file paths.
ListFoldersAsync
Lists directories in a directory.
Task<IEnumerable<string>> ListFoldersAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The directory path (null for root).
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<string>>
List of directory paths.
DeleteAsync
Deletes a file.
Task DeleteAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The file path to delete.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
DeleteFolderAsync
Deletes a folder and all its contents.
Task DeleteFolderAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The folder path to delete.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
CreateFolderAsync
Creates a folder.
Task CreateFolderAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The folder path to create.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
A task representing the asynchronous operation.
ProcessImageAsync
Processes an existing image.
Task<ImageProcessingResult> ProcessImageAsync(
IVfsConnection vfs,
string sourcePath,
string destinationPath,
ImageProcessingOptions options,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- sourcePath (string) - The source image path.
- destinationPath (string) - The destination path for processed image.
- options (ImageProcessingOptions) - Processing options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<ImageProcessingResult>
The processing result.
GenerateThumbnailsAsync
Generates thumbnails from a video.
Task<List<VideoThumbnail>> GenerateThumbnailsAsync(
IVfsConnection vfs,
string sourcePath,
ThumbnailOptions options,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- sourcePath (string) - The source video path.
- options (ThumbnailOptions) - Thumbnail options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<List<VideoThumbnail>>
List of generated thumbnails.
TranscodeVideoAsync
Transcodes a video to a different format.
Task<VideoProcessingResult> TranscodeVideoAsync(
IVfsConnection vfs,
string sourcePath,
string destinationPath,
TranscodeOptions options,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- sourcePath (string) - The source video path.
- destinationPath (string) - The destination path for transcoded video.
- options (TranscodeOptions) - Transcode options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<VideoProcessingResult>
The processing result.
GetMetadataAsync
Extracts metadata from a media file.
Task<MediaMetadata> GetMetadataAsync(
IVfsConnection vfs,
string path,
CancellationToken cancellationToken)Parameters
- vfs (IVfsConnection) - The VFS connection.
- path (string) - The file path.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<MediaMetadata>
The extracted metadata.
Properties
ProviderType
Gets the type of the vfs provider.
Type: VfsProviderType
SupportsBuckets
Gets a value indicating whether the vfs supports buckets.
Type: bool
SupportsNativeEncryptedStorage
Gets a value indicating whether the vfs supports encrypted storage.
Type: bool
SupportsStreaming
Gets a value indicating whether the vfs supports streaming.
Type: bool