Rystem.Content.Infrastructure.Storage.File 6.0.4

dotnet add package Rystem.Content.Infrastructure.Storage.File --version 6.0.4
NuGet\Install-Package Rystem.Content.Infrastructure.Storage.File -Version 6.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rystem.Content.Infrastructure.Storage.File" Version="6.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rystem.Content.Infrastructure.Storage.File --version 6.0.4
#r "nuget: Rystem.Content.Infrastructure.Storage.File, 6.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rystem.Content.Infrastructure.Storage.File as a Cake Addin
#addin nuget:?package=Rystem.Content.Infrastructure.Storage.File&version=6.0.4

// Install Rystem.Content.Infrastructure.Storage.File as a Cake Tool
#tool nuget:?package=Rystem.Content.Infrastructure.Storage.File&version=6.0.4

What is Rystem?

Integration with Azure File Storage and Content Repository

await services
    .AddContentRepository()
    .WithFileStorageIntegrationAsync(x =>
    {
        x.ShareName = "supertest";
        x.Prefix = "site/";
        x.ConnectionString = configuration["ConnectionString:Storage"];
    },
    "filestorage")
    .NoContext();

How to use in a business class

public class AllStorageTest
{
    private readonly IContentRepositoryFactory _contentRepositoryFactory;
    private readonly Utility _utility;
    public AllStorageTest(IContentRepositoryFactory contentRepositoryFactory, Utility utility)
    {
        _contentRepositoryFactory = contentRepositoryFactory;
        _utility = utility;
    }
    
    public async Task ExecuteAsync()
    {
        var _contentRepository = _contentRepositoryFactory.Create("filestorage");
        var file = await _utility.GetFileAsync();
        var name = "folder/file.png";
        var contentType = "images/png";
        var metadata = new Dictionary<string, string>()
        {
            { "name", "ale" }
        };
        var tags = new Dictionary<string, string>()
        {
            { "version", "1" }
        };
        var response = await _contentRepository.ExistAsync(name).NoContext();
        if (response)
        {
            await _contentRepository.DeleteAsync(name).NoContext();
            response = await _contentRepository.ExistAsync(name).NoContext();
        }
        Assert.False(response);
        response = await _contentRepository.UploadAsync(name, file.ToArray(), new ContentRepositoryOptions
        {
            HttpHeaders = new ContentRepositoryHttpHeaders
            {
                ContentType = contentType
            },
            Metadata = metadata,
            Tags = tags
        }, true).NoContext();
        Assert.True(response);
        response = await _contentRepository.ExistAsync(name).NoContext();
        Assert.True(response);
        var options = await _contentRepository.GetPropertiesAsync(name, ContentInformationType.All).NoContext();
        Assert.NotNull(options.Uri);
        foreach (var x in metadata)
        {
            Assert.Equal(x.Value, options.Options.Metadata[x.Key]);
        }
        foreach (var x in tags)
        {
            Assert.Equal(x.Value, options.Options.Tags[x.Key]);
        }
        Assert.Equal(contentType, options.Options.HttpHeaders.ContentType);
        metadata.Add("ale2", "single");
        response = await _contentRepository.SetPropertiesAsync(name, new ContentRepositoryOptions
        {
            HttpHeaders = new ContentRepositoryHttpHeaders
            {
                ContentType = contentType
            },
            Metadata = metadata,
            Tags = tags
        }).NoContext();
        Assert.True(response);
        options = await _contentRepository.GetPropertiesAsync(name, ContentInformationType.All).NoContext();
        Assert.Equal("single", options.Options.Metadata["ale2"]);
        response = await _contentRepository.DeleteAsync(name).NoContext();
        Assert.True(response);
        response = await _contentRepository.ExistAsync(name).NoContext();
        Assert.False(response);
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.4 207,741 4/3/2024
6.0.3 91 3/25/2024
6.0.2 83 3/11/2024
6.0.0 199 11/21/2023
6.0.0-rc.6 86 10/25/2023
6.0.0-rc.5 64 10/25/2023
6.0.0-rc.4 55 10/23/2023
6.0.0-rc.3 54 10/19/2023
6.0.0-rc.2 57 10/18/2023
6.0.0-rc.1 58 10/16/2023
5.0.20 124 9/25/2023
5.0.19 137 9/10/2023
5.0.18 130 9/6/2023
5.0.17 128 9/6/2023
5.0.16 127 9/5/2023
5.0.15 118 9/5/2023
5.0.14 122 9/5/2023
5.0.13 114 9/1/2023
5.0.12 129 8/31/2023
5.0.11 97 8/30/2023
5.0.10 141 8/29/2023
5.0.9 129 8/24/2023
5.0.8 128 8/24/2023
5.0.7 134 8/23/2023
5.0.6 131 8/21/2023
5.0.5 147 8/21/2023
5.0.4 149 8/16/2023
5.0.3 147 8/2/2023
5.0.2 147 8/2/2023