FileParty.Core 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package FileParty.Core --version 1.0.2
                    
NuGet\Install-Package FileParty.Core -Version 1.0.2
                    
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="FileParty.Core" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FileParty.Core" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="FileParty.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FileParty.Core --version 1.0.2
                    
#r "nuget: FileParty.Core, 1.0.2"
                    
#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.
#:package FileParty.Core@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FileParty.Core&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=FileParty.Core&version=1.0.2
                    
Install as a Cake Tool

FileParty

dotnet_test

Package Description Version
FileParty.Core Registration, Factory, and Watcher Nuget Package
FileParty.Providers.FileSystem Storage Providers for FileSystem Nuget Package
FileParty.Providers.AWS.S3 Storage Providers for AWS S3 Buckets Nuget Package

Providing a common set of methods for interacting with files across storage providers

How to Use

Registration

FileParty uses Microsoft.Extensions.DependencyInjection to register itself. Dependency Injection is not explicitly required to use FileParty.

Register File Party by calling this.AddFileParty() either on an existing IServiceCollection or any object. If this is not an IServiceCollection a new Service Collection will be made and returned as a result of the method call; When not using Dependency Injection, make sure to assign this to a variable.

Register each desired module calling a configuration action x => x.AddModule<ModuleName>(defaultConfigObject) where defaultConfigObject is a StorageProviderConfiguration<TModule>

This command which will register a given module and its storage providers with the Service Collection. Any quantity of modules may be added this way.

If desired, a default module may be specified, when provided this module will be the default storage provider type provided when either FilePartyFactory or AsyncFilePartyFactory returns a storage provider. When not provided, the default module shall be the last module loaded using the AddModule<TModule>(config) command.

this.AddFileParty(config => 
    config.AddModule<FileSystemModule>(new FileSystemConfiguration("C:\FilePartyBaseDirectory"))
          .SetDefaultModule<FilePartyModule>()
    
    )

Getting a Storage Provider

When you need access to an IAsyncStorageProvider or IStorageProvider there are a few options:

  • Use Dependency Injection for either an IAsyncStorageProvider or IStorageProvider and the appropriate factory will return a instance from the default module, or
  • Use Dependency Injection for either an IAsyncFilePartyFactory or IFilePartyFactory and call one of the following methods:
    • GetAsyncStorageProvider() or GetStorageProvider() to get a storage provider from the default module with the default configuration for that module, or
    • GetAsyncStorageProvider<TModule>() or GetStorageProvider<TModule>() to get a storage provider from a specified module with the default configuration for that module, or
    • GetAsyncStorageProvider<TModule>(StorageProviderConfiguration<TModule>) or GetStorageProvider<TModule>(StorageProviderConfiguration<TModule>) to get a storage provider from a specified module with a specified configuration.

The following methods are also available in the factory to return a more limited action set from the storage provider

  • Storage Readers, which include methods to check to see if a file exists, to read a file stream, and get information about a file
    • GetAsyncStorageReader() or GetStorageReader()
    • GetAsyncStorageReader<TModule>() or GetStorageReader<TModule>()
    • GetAsyncStorageReader<TModule>(StorageProviderConfiguration<TModule>) or GetStorageReader<TModule>(StorageProviderConfiguration<TModule>)
  • Storage Writers, which include methods to Write and Delete a file stream
    • GetAsyncStorageWriter() or GetStorageWriter()
    • GetAsyncStorageWriter<TModule>() or GetStorageWriter<TModule>()
    • GetAsyncStorageWriter<TModule>(StorageProviderConfiguration<TModule>) or GetStorageWriter<TModule>(StorageProviderConfiguration<TModule>)

Subscribing to Write Progress Status

Use Dependency Injection to get an IWriteProgressSubscriptionManager. Use a delegate to subscribe to all or some write progress events. Each module should have write progress updates implemented. When creating a FilePartyWriteRequest use this Id to subscribe to write progress updates for a specific file stream.

Changing Default Configs On-The-Fly

Use Dependency Injection to get an IFilePartyFactoryModifier and use the sole method to set a new default module and configuration. This will change which Storage Providers are returned by the default factory methods.

How to Extend

Create a project that implements:

  • BaseAsyncStorageProvider
  • BaseStorageProvider
  • BaseFilePartyModule

Please be mindful to include updates for write progress.

Additional services may be registered in the module's independent service collection.

Questions / Issues / Concerns

Just make an issue on the Repo.

  • Contributions are welcome.
  • Please make PRs into develop and remember to increment the version number for each project.
  • Please name branches in the following formats
  • /bugfix/issue-fixed
  • /feature/feature-added
  • Release PRs will go into main
  • Please write unit tests
  • If adding a new storage provider
  • please make a new repository
  • use the following namespace format, marking External as it is not maintained by Jankware: FileParty.Providers.External.YourProvider
  • let us know about it, we're very interested
  • we may ask to make this part of the core code in the future
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on FileParty.Core:

Package Downloads
FileParty.Providers.AWS.S3

Agnostic File Storage, AWS S3 Module

FileParty.Providers.FileSystem

Agnostic File Storage, Filesystem Module

FileParty.Providers.Azure.Storage

Agnostic File Storage, AWS S3 Module

FileParty.Providers.FTP

Agnostic File Storage, FTP Module

GitHub repositories

This package is not used by any popular GitHub repositories.