-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIFileStorage.cs
More file actions
22 lines (18 loc) · 845 Bytes
/
IFileStorage.cs
File metadata and controls
22 lines (18 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using GroupDocs.Viewer.UI.Core.Entities;
namespace GroupDocs.Viewer.UI.Core
{
public interface IFileStorage
{
Task<IEnumerable<FileSystemEntry>> ListDirsAndFilesAsync(string dirPath, CancellationToken cancellationToken = default);
Task<byte[]> ReadFileAsync(string filePath, CancellationToken cancellationToken = default);
/// <summary>
/// Reads the file as a stream. The caller is responsible for disposing the returned stream.
/// </summary>
Task<Stream> ReadFileStreamAsync(string filePath, CancellationToken cancellationToken = default);
Task<string> WriteFileAsync(string fileName, byte[] bytes, bool rewrite, CancellationToken cancellationToken = default);
}
}