![]() |
VOOZH | about |
dotnet add package Oakrey.Applications.Files.Abstractions --version 6.0.0
NuGet\Install-Package Oakrey.Applications.Files.Abstractions -Version 6.0.0
<PackageReference Include="Oakrey.Applications.Files.Abstractions" Version="6.0.0" />
<PackageVersion Include="Oakrey.Applications.Files.Abstractions" Version="6.0.0" />Directory.Packages.props
<PackageReference Include="Oakrey.Applications.Files.Abstractions" />Project file
paket add Oakrey.Applications.Files.Abstractions --version 6.0.0
#r "nuget: Oakrey.Applications.Files.Abstractions, 6.0.0"
#:package Oakrey.Applications.Files.Abstractions@6.0.0
#addin nuget:?package=Oakrey.Applications.Files.Abstractions&version=6.0.0Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.Files.Abstractions&version=6.0.0Install as a Cake Tool
A .NET 10 library that defines the IFileService abstraction for file and directory operations.
It contains no implementation code and carries no runtime dependencies, making it the correct
reference for libraries and application layers that need file access without coupling to a
concrete implementation.
| Method | Description |
|---|---|
CreateFolder(folderName) |
Creates a directory at the given path |
CreateSaveStream(fileName) |
Opens a writable FileStream for the given file |
DeleteFile(fileName) |
Deletes a single file by path |
DeleteFileOlderThan(path, timeSpan, extension, ct) |
Deletes files in a directory that are older than the given TimeSpan, filtered by extension |
GetFilesPaths(folder, extension) |
Returns all file paths inside a directory tree matching the given extension |
LoadFile(fileName) |
Reads file content as a string (synchronous) |
LoadFileAsync(fileName, ct) |
Reads file content as a string (asynchronous, CancellationToken aware) |
LoadFileStream(fileName) |
Opens a readable FileStream for the given file |
SaveFile(fileName, value) |
Writes a string to a file, creating intermediate directories if needed |
classDiagram
class IFileService {
+CreateFolder(folderName)
+CreateSaveStream(fileName) FileStream
+DeleteFile(fileName)
+DeleteFileOlderThan(path, timeSpan, extension, ct) Task
+GetFilesPaths(folder, extension) string[]
+LoadFile(fileName) string
+LoadFileAsync(fileName, ct) Task~string~
+LoadFileStream(fileName) FileStream
+SaveFile(fileName, value)
}
class FileService {
<<Oakrey.Applications.Files>>
}
IFileService <|.. FileService
The concrete implementation lives in the separate Oakrey.Applications.Files package.
Consuming projects should reference only this abstractions package and register the
implementation via the extension provided by Oakrey.Applications.Files.
dotnet add package Oakrey.Applications.Files.Abstractions
To also include the concrete implementation:
dotnet add package Oakrey.Applications.Files
// In your composition root, reference Oakrey.Applications.Files for the extension method.
services.AddFilesService();
public sealed class ReportExporter
{
private readonly IFileService _fileService;
public ReportExporter(IFileService fileService)
{
_fileService = fileService;
}
public async Task ExportAsync(string path, string content, CancellationToken cancellationToken)
{
_fileService.CreateFolder(System.IO.Path.GetDirectoryName(path)!);
_fileService.SaveFile(path, content);
}
public async Task<string> LoadAsync(string path, CancellationToken cancellationToken)
{
return await _fileService.LoadFileAsync(path, cancellationToken);
}
}
await _fileService.DeleteFileOlderThan(
path: @"C:\Logs",
timeSpan: TimeSpan.FromDays(30),
extensionWithoutDot: "log",
cancellationToken: cancellationToken);
IFileService interface. No implementation, logging, or
telemetry code is included.FileService) is in Oakrey.Applications.Files and adds
thread-safe async access via SemaphoreSlim, structured logging via Oakrey.Log, and
OpenTelemetry activity spans via Oakrey.Telemetry.Oakrey.Applications.Files root namespace.MIT � Copyright � Oakrey 2016-present
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Oakrey.Applications.Files.Abstractions:
| Package | Downloads |
|---|---|
|
Oakrey.Applications.Settings
WPF-only (.NET 10 Windows) library providing ISettingsService with persistent and volatile typed key-value settings, SettingsBase for bindable ViewModelBase-derived settings classes, CallerMemberName key inference, built-in window bounds restore via RestoreBounds, and a one-call ConfigureSettingService DI extension. |
|
|
Oakrey.Applications.Log
Integrates Oakrey logging into .NET WPF apps via IServiceCollection extensions: registers a WpfQueueLogger for real-time UI log visualization, a settings-persisted LogViewModel with log-level filtering, and a preloadable log file cleanup service with a 7-day retention policy. |
|
|
Oakrey.Applications.Json
Provides IJsonService for stream-based JSON serialization and deserialization using System.Text.Json, with async CancellationToken support, batch directory load, IName-keyed batch save, and built-in logging and OpenTelemetry tracing via IFileService. |
|
|
Oakrey.Applications.Files
Provides IFileService with synchronous and asynchronous file and directory operations including CRUD, stream access, and age-based deletion, with built-in logging and OpenTelemetry tracing. |
|
|
Oakrey.Applications.Ohm.CAN
Service layer library for managing CAN bus hardware devices and channels. Provides device discovery, connection lifecycle management, reactive IObservable streams for received frames and status changes, per-channel transmit, USB hot-plug detection, and persistent JSON configuration. |
This package is not used by any popular GitHub repositories.