![]() |
VOOZH | about |
dotnet add package DoenaSoft.AbstractionLayer.IO --version 6.0.6
NuGet\Install-Package DoenaSoft.AbstractionLayer.IO -Version 6.0.6
<PackageReference Include="DoenaSoft.AbstractionLayer.IO" Version="6.0.6" />
<PackageVersion Include="DoenaSoft.AbstractionLayer.IO" Version="6.0.6" />Directory.Packages.props
<PackageReference Include="DoenaSoft.AbstractionLayer.IO" />Project file
paket add DoenaSoft.AbstractionLayer.IO --version 6.0.6
#r "nuget: DoenaSoft.AbstractionLayer.IO, 6.0.6"
#:package DoenaSoft.AbstractionLayer.IO@6.0.6
#addin nuget:?package=DoenaSoft.AbstractionLayer.IO&version=6.0.6Install as a Cake Addin
#tool nuget:?package=DoenaSoft.AbstractionLayer.IO&version=6.0.6Install as a Cake Tool
File I/O interface contracts to simplify unit testing of file operations. This project contains interface definitions only and targets .NET Standard 2.0, .NET Framework 4.7.2, and .NET 10 to be usable from multiple framework versions.
Package Id: DoenaSoft.AbstractionLayer.IO
Targets: netstandard2.0, net472, net10.0
This package contains only the interface contracts for file I/O abstractions. For production use, you'll also need the default implementations package: DoenaSoft.AbstractionLayer.IO.Default which contains System.IO-based implementations of these interfaces.
License: MIT
The project provides several interfaces that represent parts of the file system. The primary entry point is IIOServices and the contracts include:
IIOServices - The main entry point that aggregates access to all I/O services. Provides factory methods for files, folders, drives, and file system watchers.IIOServiceItem - Base interface for all types that provide access to the master IIOServices interface. All file system-related interfaces inherit from this.IPath - Provides path manipulation helpers (combine, get extension, get folder name, change extension, etc.)IFile - Static file operations (exists, copy, move, delete, read all bytes/lines/text, write all bytes/lines/text, append, open streams, get/set attributes and timestamps, replace, etc.)IFileInfo - Instance-based file operations and metadata (name, extension, full name, folder, size, attributes, timestamps, exists, copy, move, delete, open streams, create text, etc.)IFolder - Static folder operations (exists, create, delete, get files/folders, move, get/set current folder, get parent, etc.)IFolderInfo - Instance-based folder operations and metadata (name, full name, parent, root, drive, attributes, timestamps, exists, create, delete, move, get files/folders, etc.)IDriveInfo - Drive-specific information (name, drive type, drive format, drive letter, volume label, ready state, available free space, total free space, total size, root folder, etc.)IFileSystemWatcher - File system change notification abstraction with events for file creation, deletion, and renaming.ILogger - Logging abstraction used by implementations to record I/O operations.IRenameQueue - Queue abstraction for managing mass file rename operations with automatic rollback support. Supports progress reporting and configurable rollback behavior.IRenameProgress - Progress information for rename queue operations (total, completed, current files, percent complete).IRenameResult - Result information for rename operations including successful/failed files and rollback details.IRenameResultDetail - Details of a single rename operation (source, target, error message).IShortcut - Abstraction for creating and managing file shortcuts with description, target path, and working folder.RenameRollbackBehaviour - Specifies rollback behavior when rename operations fail (Automatic, Manual, None).Program against these interfaces and inject implementations at runtime. For the default System.IO-based implementations, reference the DoenaSoft.AbstractionLayer.IO.Default package:
using DoenaSoft.AbstractionLayer.IOServices;
public class FileProcessor
{
private readonly IIOServices _io;
public FileProcessor(IIOServices io)
{
_io = io;
}
public string ReadFirstLine(string path)
{
var fileContent = _io.File.ReadAllText(path);
return fileContent.Split('\n')[0];
}
}
// In your application startup (using DoenaSoft.AbstractionLayer.IO.Default):
var io = new IOServices();
var processor = new FileProcessor(io);
Reference only this contracts package and provide test doubles to avoid disk I/O:
class FakeFile : IFile
{
public IIOServices IOServices { get; }
public bool Exists(string fileName) => true;
public string ReadAllText(string path) => "line 1\nline 2";
// ... implement other IFile members used by your code
}
class FakeIOServices : IIOServices
{
public IPath Path => throw new NotImplementedException();
public IFile File => new FakeFile();
public IFolder Folder => throw new NotImplementedException();
// ... implement only the members your tests need
}
// In your test
var fake = new FakeIOServices();
var processor = new FileProcessor(fake);
var firstLine = processor.ReadFirstLine("any.txt");
Assert.AreEqual("line 1", firstLine);
IIOServices fake during tests to avoid touching the diskDoenaSoft.AbstractionLayer.IO (this package) - Interface contracts onlyDoenaSoft.AbstractionLayer.IO.Default - Default System.IO-based implementations (depends on this package)For production use, reference DoenaSoft.AbstractionLayer.IO.Default. For unit tests, reference only this contracts package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 3 NuGet packages that depend on DoenaSoft.AbstractionLayer.IO:
| Package | Downloads |
|---|---|
|
DoenaSoft.AdaptBookFileNames
A .NET library for organizing and standardizing audiobook and e-book file names with consistent naming conventions. Supports MP3, M4A, MP4 audiobooks and EPUB, MOBI e-books with sequential numbering and chapter management. |
|
|
DoenaSoft.AbstractionLayer.IO.Default
Default System.IO-based implementations of the file I/O abstraction interfaces from DoenaSoft.AbstractionLayer.IO. Provides production-ready wrappers for File, Directory, Path, FileInfo, DirectoryInfo, DriveInfo, and FileSystemWatcher with optional logging support. |
|
|
DoenaSoft.DownloadFileRenamer
Lib for handling DownloadRenamer |
This package is not used by any popular GitHub repositories.