IMediaMaticService
Namespace: MJCZone.MediaMatic.AspNetCore.Services
Assembly: MJCZone.MediaMatic.AspNetCore
Summary
Service interface for MediaMatic operations in ASP.NET Core applications.
abstract public
Note: This is an interface that defines a contract. Look for implementing classes in the same or related namespaces.
Contents
Methods (23)
Methods
| Method | Summary |
|---|---|
| GetFilesourcesAsync | Gets all registered datasources. |
| GetFilesourceAsync | Gets datasource information by name. |
| AddFilesourceAsync | Adds a new datasource. |
| UpdateFilesourceAsync | Updates an existing datasource. |
| RemoveFilesourceAsync | Removes a datasource. |
| FilesourceExistsAsync | Checks if a datasource exists. |
| TestFilesourceAsync | Tests the connection to a datasource. |
| GetFileMetadataAsync | Gets metadata for a file. |
| TransformImageAsync | Transforms an image with specified processing options. |
| ListFilesAsync | Lists files in a directory. |
| ListAsync | Lists files and folders in a directory with rich metadata. |
| DownloadFileAsync | Downloads a file. |
| UploadFileAsync | Uploads a file. |
| DeleteFileAsync | Deletes a file. |
| FileExistsAsync | Checks if a file exists. |
| ListFoldersAsync | Lists folders in a directory. |
| CreateFolderAsync | Creates a folder. |
| DeleteFolderAsync | Deletes a folder and all its contents. |
| CreateFolderArchiveAsync | Creates an archive of a folder. |
| CreateFileListArchiveAsync | Creates an archive from a list of files and folders. |
| ListArchivesAsync | Lists all archives in a folder. |
| DownloadArchiveAsync | Downloads an archive file. |
| DeleteArchiveAsync | Deletes an archive file. |
GetFilesourcesAsync
Gets all registered datasources.
Task<IEnumerable<FilesourceDto>> GetFilesourcesAsync(
IOperationContext context,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<FilesourceDto>>
List of datasource information.
GetFilesourceAsync
Gets datasource information by name.
Task<FilesourceDto> GetFilesourceAsync(
IOperationContext context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasourceId (string) - The id of the datasource.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<FilesourceDto>
The datasource information.
AddFilesourceAsync
Adds a new datasource.
Task<FilesourceDto> AddFilesourceAsync(
IOperationContext context,
FilesourceDto datasource,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasource (FilesourceDto) - The datasource to add.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<FilesourceDto>
The added datasource if successful.
UpdateFilesourceAsync
Updates an existing datasource.
Task<FilesourceDto> UpdateFilesourceAsync(
IOperationContext context,
FilesourceDto datasource,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasource (FilesourceDto) - The updated datasource information.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<FilesourceDto>
The updated datasource.
RemoveFilesourceAsync
Removes a datasource.
Task RemoveFilesourceAsync(
IOperationContext context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasourceId (string) - The id of the datasource to remove.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
FilesourceExistsAsync
Checks if a datasource exists.
Task<bool> FilesourceExistsAsync(
IOperationContext context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasourceId (string) - The id of the datasource to check.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<bool>
True if the datasource exists, false otherwise.
TestFilesourceAsync
Tests the connection to a datasource.
Task<FilesourceConnectivityTestDto> TestFilesourceAsync(
IOperationContext context,
string datasourceId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- datasourceId (string) - The id of the datasource to test.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<FilesourceConnectivityTestDto>
Test result containing connection status and details.
GetFileMetadataAsync
Gets metadata for a file.
Task<MediaMetadata> GetFileMetadataAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The file path.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<MediaMetadata>
File metadata.
TransformImageAsync
Transforms an image with specified processing options.
Task<Stream> TransformImageAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
ImageProcessingOptions options,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The source file path.
- options (ImageProcessingOptions) - Image processing options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<Stream>
Stream containing the transformed image.
ListFilesAsync
Lists files in a directory.
Task<IEnumerable<string>> ListFilesAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string path,
bool recursive,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- path (string) - The directory path (null for root).
- recursive (bool) - Whether to list files recursively.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<string>>
List of file paths.
ListAsync
Lists files and folders in a directory with rich metadata.
Task<BrowseResponseDto> ListAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string path,
BrowseOptions options,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- path (string) - The directory path (null for root).
- options (BrowseOptions) - Browse options for filtering and field selection.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<BrowseResponseDto>
Browse response containing files and folders with metadata.
DownloadFileAsync
Downloads a file.
Task<Stream> DownloadFileAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The file path to download.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<Stream>
Stream containing the file data.
UploadFileAsync
Uploads a file.
Task<string> UploadFileAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
Stream stream,
bool overwrite,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The target file path.
- stream (Stream) - The file stream to upload.
- overwrite (bool) - Whether to overwrite existing files.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<string>
The path to the uploaded file.
DeleteFileAsync
Deletes a file.
Task DeleteFileAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The file path to delete.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
FileExistsAsync
Checks if a file exists.
Task<bool> FileExistsAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string filePath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- filePath (string) - The file path to check.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<bool>
True if the file exists.
ListFoldersAsync
Lists folders in a directory.
Task<IEnumerable<string>> ListFoldersAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string path,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- path (string) - The directory path (null for root).
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<string>>
List of folder paths.
CreateFolderAsync
Creates a folder.
Task<bool> CreateFolderAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string folderPath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- folderPath (string) - The folder path to create.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<bool>
True if the folder was created, false if it already exists.
DeleteFolderAsync
Deletes a folder and all its contents.
Task DeleteFolderAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string folderPath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- folderPath (string) - The folder path to delete.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.
CreateFolderArchiveAsync
Creates an archive of a folder.
Task<ArchiveResponse> CreateFolderArchiveAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string folderPath,
ArchiveRequest request,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- folderPath (string) - The folder path to archive.
- request (ArchiveRequest) - Archive creation options.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<ArchiveResponse>
Archive response containing job ID and archive information.
CreateFileListArchiveAsync
Creates an archive from a list of files and folders.
Task<ArchiveResponse> CreateFileListArchiveAsync(
IOperationContext context,
string filesourceId,
string bucketName,
ArchiveRequest request,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- request (ArchiveRequest) - Archive request containing the list of paths.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<ArchiveResponse>
Archive response containing job ID and archive information.
ListArchivesAsync
Lists all archives in a folder.
Task<IEnumerable<ArchiveInfo>> ListArchivesAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string folderPath,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- folderPath (string) - The folder path containing archives.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<IEnumerable<ArchiveInfo>>
List of archive information.
DownloadArchiveAsync
Downloads an archive file.
Task<Stream> DownloadArchiveAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string archiveId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- archiveId (string) - The archive identifier.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task<Stream>
Stream containing the archive data.
DeleteArchiveAsync
Deletes an archive file.
Task DeleteArchiveAsync(
IOperationContext context,
string filesourceId,
string bucketName,
string archiveId,
CancellationToken cancellationToken)Parameters
- context (IOperationContext) - The operation context.
- filesourceId (string) - The filesource identifier.
- bucketName (string) - Optional bucket name (for S3/Azure).
- archiveId (string) - The archive identifier.
- cancellationToken (CancellationToken) - Cancellation token.
Returns
Type: Task
Task representing the asynchronous operation.