VersaTul.Handler.File 1.0.19

Prefix Reserved
dotnet add package VersaTul.Handler.File --version 1.0.19                
NuGet\Install-Package VersaTul.Handler.File -Version 1.0.19                
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="VersaTul.Handler.File" Version="1.0.19" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VersaTul.Handler.File --version 1.0.19                
#r "nuget: VersaTul.Handler.File, 1.0.19"                
#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 VersaTul.Handler.File as a Cake Addin
#addin nuget:?package=VersaTul.Handler.File&version=1.0.19

// Install VersaTul.Handler.File as a Cake Tool
#tool nuget:?package=VersaTul.Handler.File&version=1.0.19                

VersaTul Handler File

This project provides the functionality needed to work with files on hard-disks. It supports creating, reading, and deleting of custom file types found in the project. It is a wrapper project around the System.IO.File namespace and was designed to make working with the VersaTul custom FileInfo class much easier.

Features

  • IDirectoryWrapper: Interface used to expose System.IO.File methods pertaining to Directory manipulation.
  • IFileHandler: Interface used for providing the general File manipulation functionalities.
  • IFileWrapper: Interface used to expose System.IO.File methods pertaining to File manipulation.
  • IFileUtility: Interface used to provide File and Directory read and write functionalities. Inherits the IFileHandler interface.
  • FileHandler: An abstract class that implements the IFileHandler Interface.
  • FileUtility: The concrete implementation of the IFileUtility Interface.
  • DirectoryWrapper: The concrete implementation of IDirectoryWrapper and IFileWrapper Interfaces.
  • BaseInfo: An abstract base class that represents the basic information provided by a FileInfo class.
  • FileInfo: A custom VersaTul class used to represent a file details and its contents.
  • CsvFileInfo: Class that represents a csv file details and its contents.
  • TextFileInfo: Class that represents a text file details and its contents.
  • ZipFileInfo: Class that represents a zip file details and its contents as a stream.
  • StreamFileInfo: Class that represents a file details and its contents as a stream.
  • CustomFileInfo: Class used to represent a custom file (maybe a project specific file with its own extension) details and its contents.

Usage

To use this project, you need to create instances of the classes and interfaces provided. For example, to read data from a file, you can use the following code:

using VersaTul.Handler.File.Contracts;
using VersaTul.Handler.File.Types;
using VersaTul.Utilities.Contracts;

class Program
{
    static void Main(string[] args)
    {
        // Create instances
        var directoryWrapper = new DirectoryWrapper();
        var fileUtility = new FileUtility(directoryWrapper, directoryWrapper);

        // file to read
        var fullFilePath = "c:\\some\\path\\filename.txt";

        // Open and read data from file.
        FileResult data = fileUtility.ReadAllLines(fullFilePath);

        if (data.IsExists)
        {
            Print("Here is your file data");
            Print("=========================");
            data.Content.ToList().ForEach(val => Print(val));
        }
        else
        {
            Print($"No file @:' {fullFilePath}'");
        }
    }

    Console.ReadLine();
}

For more details on the methods and parameters of each class and interface, please refer to the web page VersaTul Handler File.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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.  net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on VersaTul.Handler.File:

Package Downloads
VersaTul.Collection.Streamers

The VersaTul Collection Streamers provides functionality that enables developers to quickly convert a collection of objects in memory into a data-reader that can be used for Bulk inserting data into a SQL Database, or be used to generate flat files. Developers can use the streamers to: 1. Convert a Collection to a Data-Reader. 2. Convert from a Data-Reader to other file formats such as CSV, TAB or Json. 3. Compress converted data into Zip files. 4. Transport the converted data via e-mail. The Streamers project also works with Display Attributes which is used to manipulate the properties on the objects in the collection such as formatting the data or renaming the property with a desired display name.

VersaTul.Logger.File

The VersaTul Logger File project provides the functionality needed to performing logging in a flat file. This project implements the ILogger interface from the VersaTul Logger project.

VersaTul.Task.Scheduler

The VersaTul Task Scheduler project provides functionality to schedule events then listen to and react to those events. This is ideal for windows service type applications that may run tasks based on certain time or day. Events can be scheduled from seconds, minutes, hours, days and many more combinations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.19 115 12/10/2024
1.0.18 86 12/9/2024
1.0.17 410 3/1/2024
1.0.16 170 2/2/2024
1.0.15 226 1/25/2024
1.0.14 161 1/23/2024
1.0.13 167 1/23/2024
1.0.12 256 1/11/2024
1.0.11 208 1/11/2024
1.0.10 261 12/16/2023
1.0.9 279 7/24/2023
1.0.8 268 7/22/2023