Interface IDocumentStorage
Defines a contract for reading, writing, and deleting documents in a storage provider.
Namespace: Syncfusion.AI.AgentTools.Core
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public interface IDocumentStorage
Remarks
Implement this interface to integrate with any storage backend such as Azure Blob Storage, Amazon S3, local file system, or any other custom provider. The implementation is used by DocumentStorageManager in DocumentStorage mode (Mode 2) to manage document lifecycle operations.
Methods
Exists(String)
Checks whether a document exists at the specified path in the storage.
Declaration
bool Exists(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The relative or absolute path identifying the document to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the document exists; otherwise, false. |
Read(String)
Reads a document from the storage and returns its content as a stream.
Declaration
Stream Read(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The relative or absolute path identifying the document in the storage. |
Returns
| Type | Description |
|---|---|
| System.IO.Stream | A System.IO.Stream containing the document content. The caller is responsible for disposing the stream. |
Write(String, Stream)
Writes a document to the storage, creating or overwriting the file at the specified path.
Declaration
bool Write(string filePath, Stream documentStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The relative or absolute path identifying the document in the storage. |
| System.IO.Stream | documentStream | The stream containing the document content to write. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the write operation succeeded; otherwise, false. |