Class FolderOutputHandler
Contents
[
Hide
]FolderOutputHandler class
An implementation of IOutputHandler
that writes output streams to files in a specified folder.
public class FolderOutputHandler : IOutputHandler
Constructors
Name | Description |
---|---|
FolderOutputHandler(string) | Initializes a new instance of the FolderOutputHandler class with the specified output folder path. |
Properties
Name | Description |
---|---|
Path { get; set; } | Gets or sets the target folder path where output files will be written. |
Methods
Name | Description |
---|---|
AddOutputStream(string, Action<Stream>) | |
AddOutputStream(string, Func<Stream, Task>) |
Examples
Example usage:
var outputHandler = new FolderOutputHandler("C:\\Output");
await outputHandler.AddOutputStream("example.txt", async stream =>
{
using var writer = new StreamWriter(stream);
await writer.WriteLineAsync("Hello from async!");
});
outputHandler.AddOutputStream("example_sync.txt", stream =>
{
using var writer = new StreamWriter(stream);
writer.WriteLine("Hello from sync!");
});
See Also
- interface IOutputHandler
- namespace Aspose.Email.LowCode
- assembly Aspose.Email