FileStorageService 1.3.0

dotnet add package FileStorageService --version 1.3.0
                    
NuGet\Install-Package FileStorageService -Version 1.3.0
                    
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="FileStorageService" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FileStorageService" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="FileStorageService" />
                    
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 FileStorageService --version 1.3.0
                    
#r "nuget: FileStorageService, 1.3.0"
                    
#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 FileStorageService@1.3.0
                    
#: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=FileStorageService&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=FileStorageService&version=1.3.0
                    
Install as a Cake Tool

Title: FileStorageService - File Operation Library for Google Drive, SharePoint, and FTP

For any bug-related concerns, please feel free to reach out to us at "fileoperationservice@gmail.com".

Description: FileStorageService is a powerful and versatile NuGet package designed to streamline file operations across three popular cloud platforms: Google Drive, SharePoint, and FTP (File Transfer Protocol). This comprehensive library provides developers with a unified and intuitive interface to interact with files, folders, and directories, enabling seamless integration with multiple cloud storage services.

Features:

File Management Made Easy: With MultiCloudFileUtils, developers can perform various file operations, such as uploading, downloading, copying, moving, and deleting files effortlessly across Google Drive, SharePoint, and FTP. The package abstracts the underlying complexities of each cloud service, providing a consistent set of methods and functionalities.

Google Drive Integration: MultiCloudFileUtils seamlessly integrates with Google Drive, enabling efficient interaction with files and folders hosted on Google's cloud storage service. Developers can leverage the library to authenticate, create, read, update, and delete files and folders, as well as retrieve metadata and perform search operations.

SharePoint Integration: The package offers comprehensive support for SharePoint, allowing developers to access and manage files and folders stored within SharePoint sites. It provides methods to authenticate, read, create, update, and delete SharePoint files, as well as perform other operations like listing folders, retrieving metadata, and executing search queries.

FTP Compatibility: MultiCloudFileUtils simplifies FTP file operations, enabling developers to interact with FTP servers seamlessly. It includes functionality to connect to FTP servers, upload and download files, rename and delete files, create directories, and perform various other FTP operations.

Error Handling and Logging: The library incorporates robust error-handling mechanisms to ensure smooth execution of file operations. It provides informative error messages and supports logging capabilities, allowing developers to diagnose issues quickly and effectively.

Customization and Extensibility: MultiCloudFileUtils allows customization and extension to meet specific application requirements. Developers can utilize various configuration options, tweak behaviour settings, and extend functionality through well-defined interfaces and events.

Whether you are building a cloud-based document management system, a file synchronization tool, or any application that requires seamless file operations across Google Drive, SharePoint, and FTP, MultiCloudFileUtils simplifies the development process, saving you time and effort.

Get started today with FileStorageService and unlock the power of unified file management across Google Drive, SharePoint, and FTP services.

public class RunService
{
    private readonly IFileStorage fileStorage;

    public RunService(FileStorageType fileStorageType)
    {
        fileStorage = fileStorageType == FileStorageType.GoogleDrive ? this.GetGoogleService(fileStorageType) : GetOtherService(fileStorageType);
    }

    public void UploadFile()
    {
        byte[] byteArray = File.ReadAllBytes(@"D:\test.txt");

        this.fileStorage.Upload("TestFile.png", DateTime.Today.ToString("yyyyMMdd") + "/Test", byteArray);
    }

    public void DownloadFile()
    {
        byte[] byteArray = this.fileStorage.Get_Byte(DateTime.Today.ToString("yyyyMMdd") + "/Test", "test.txt");

        File.WriteAllBytes("", byteArray);
    }

    private IFileStorage GetGoogleService(FileStorageType fileStorageType)
    {
        // Load the Service account credentials and define the scope of its access. for more details. Please visit Google drive service account creation at following URL -  
        var jsonData = File.ReadAllText(@"D:\testproject-389312-7a149dbc0173.json");

        string baseLocatoin = "1SyM6L1cVWCFHcWEuHVotv8oJM7oeeVUe"; //Shared Google Drive folder path.

        var credential = new ConnectionCredential() { JsonCredential = jsonData, BaseLocation = baseLocatoin };

        IFileStorageService fileStorageService = new FileStorageService();

        return fileStorageService.GetFileStorage(credential, fileStorageType);
    }

    private IFileStorage GetOtherService(FileStorageType fileStorageType)
    {
        
        string baseLocatoin = "xxxxx"; //Optional
        string serverURL = "";
        string userName = "";
        string password = "";

        var credential = new ConnectionCredential() { ServerURL = serverURL, UserName = userName, Password = password, BaseLocation = baseLocatoin };

        IFileStorageService fileStorageService = new FileStorageService();

        return fileStorageService.GetFileStorage(credential, fileStorageType);
    }
}
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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
1.3.0 407 6/15/2023
1.2.0 412 6/14/2023 1.2.0 is deprecated because it has critical bugs.