* 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>
34 lines
944 B
C#
34 lines
944 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Elsa.IO.Extensions;
|
|
|
|
namespace Elsa.IO.Models;
|
|
|
|
/// <summary>
|
|
/// Represents normalized binary content with metadata.
|
|
/// </summary>
|
|
public class BinaryContent
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the name of the content.
|
|
/// </summary>
|
|
public string? Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets the content type (MIME type) based on file extension.
|
|
/// </summary>
|
|
public string? ContentType => !string.IsNullOrWhiteSpace(Name)
|
|
? Path.GetExtension(Name).GetContentTypeFromExtension()
|
|
: null;
|
|
|
|
/// <summary>
|
|
/// Gets or sets optional metadata headers.
|
|
/// </summary>
|
|
public IDictionary<string, object> Headers { get; set; } = new Dictionary<string, object>();
|
|
|
|
/// <summary>
|
|
/// Gets or sets the content stream.
|
|
/// </summary>
|
|
public Stream Stream { get; init; } = null!;
|
|
}
|