Skip to content

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

MethodSummary
UploadFileAsyncUploads a file to the virtual file system.
UploadImageAsyncUploads and processes an image.
UploadVideoAsyncUploads and processes a video.
DownloadAsyncDownloads a file from the virtual file system.
ExistsAsyncChecks if a file exists.
ListFilesAsyncLists files in a directory.
ListFoldersAsyncLists directories in a directory.
DeleteAsyncDeletes a file.
DeleteFolderAsyncDeletes a folder and all its contents.
CreateFolderAsyncCreates a folder.
ProcessImageAsyncProcesses an existing image.
GenerateThumbnailsAsyncGenerates thumbnails from a video.
TranscodeVideoAsyncTranscodes a video to a different format.
GetMetadataAsyncExtracts metadata from a media file.

UploadFileAsync

Uploads a file to the virtual file system.

csharp
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.

csharp
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.

csharp
Task&lt;VideoUploadResult&gt; 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.

csharp
Task&lt;Stream&gt; 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&lt;Stream&gt;

A stream containing the file data.

ExistsAsync

Checks if a file exists.

csharp
Task&lt;bool&gt; 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&lt;bool&gt;

True if the file exists.

ListFilesAsync

Lists files in a directory.

csharp
Task&lt;IEnumerable&lt;string&gt;&gt; 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&lt;IEnumerable&lt;string&gt;&gt;

List of file paths.

ListFoldersAsync

Lists directories in a directory.

csharp
Task&lt;IEnumerable&lt;string&gt;&gt; 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&lt;IEnumerable&lt;string&gt;&gt;

List of directory paths.

DeleteAsync

Deletes a file.

csharp
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.

csharp
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.

csharp
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.

csharp
Task&lt;ImageProcessingResult&gt; 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.

csharp
Task&lt;List&lt;VideoThumbnail&gt;&gt; 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.

csharp
Task&lt;VideoProcessingResult&gt; 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.

csharp
Task&lt;MediaMetadata&gt; 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