* Io module and content strategies * Restructuring the folders and projects * Create zip activity + shared content resolver * Fixing build on github.com * Update src/modules/Elsa.IO/Services/ContentResolver.cs explicit nullable field Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com> * QoL improvements * More QoL improvements + removing some logic duplications * Update src/modules/Elsa.IO.Compression/Activities/CreateZipArchive.cs avoiding duplicate extensions Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Assigning file path correctly to the variable * More QoL changes, new Elsa.IO.Http module, more modular content strategy * Addresing QoL review comments + Correct extension handling --------- Co-authored-by: lucas.hipolito <lukhipolito@yahoo.com.br> Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
namespace Elsa.IO.Services.Strategies;
|
|
|
|
using Elsa.IO.Models;
|
|
|
|
/// <summary>
|
|
/// Defines a strategy for resolving specific content types to BinaryContent.
|
|
/// </summary>
|
|
public interface IContentResolverStrategy
|
|
{
|
|
/// <summary>
|
|
/// The priority of the strategy.
|
|
/// </summary>
|
|
float Priority { get; }
|
|
|
|
/// <summary>
|
|
/// Determines if this strategy can handle the specified content.
|
|
/// </summary>
|
|
/// <param name="content">The content to check.</param>
|
|
/// <returns>True if this strategy can handle the content, false otherwise.</returns>
|
|
bool CanResolve(object content);
|
|
|
|
/// <summary>
|
|
/// Resolves the content to a BinaryContent object that includes the content stream and metadata.
|
|
/// </summary>
|
|
/// <param name="content">The content to resolve.</param>
|
|
/// <param name="cancellationToken">A cancellation token.</param>
|
|
/// <returns>A BinaryContent object containing the content stream and associated metadata.</returns>
|
|
Task<BinaryContent> ResolveAsync(object content, CancellationToken cancellationToken = default);
|
|
} |