41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
using System.IO;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Nop.Plugin.Misc.FruitBankPlugin.Services.FileStorage
|
|
{
|
|
/// <summary>
|
|
/// Interface for file storage providers (local, Azure, S3, etc.)
|
|
/// </summary>
|
|
public interface IFileStorageProvider
|
|
{
|
|
/// <summary>
|
|
/// Saves a file stream to the specified relative path
|
|
/// </summary>
|
|
/// <param name="fileStream">The file stream to save</param>
|
|
/// <param name="relativePath">Relative path from storage root (e.g., "123/AIdocumentprocessing/ShippingDocuments-456/file.pdf")</param>
|
|
/// <returns>The full path where the file was saved</returns>
|
|
Task<string> SaveFileAsync(Stream fileStream, string relativePath);
|
|
|
|
/// <summary>
|
|
/// Retrieves a file stream from the specified relative path
|
|
/// </summary>
|
|
/// <param name="relativePath">Relative path from storage root</param>
|
|
/// <returns>File stream</returns>
|
|
Task<Stream> GetFileAsync(string relativePath);
|
|
|
|
/// <summary>
|
|
/// Deletes a file at the specified relative path
|
|
/// </summary>
|
|
/// <param name="relativePath">Relative path from storage root</param>
|
|
/// <returns>True if deleted successfully</returns>
|
|
Task<bool> DeleteFileAsync(string relativePath);
|
|
|
|
/// <summary>
|
|
/// Checks if a file exists at the specified relative path
|
|
/// </summary>
|
|
/// <param name="relativePath">Relative path from storage root</param>
|
|
/// <returns>True if file exists</returns>
|
|
Task<bool> FileExistsAsync(string relativePath);
|
|
}
|
|
}
|