Table of Contents

Interface ILocalStorageAdapter

Namespace
PowerSync.Common.Attachments
Assembly
PowerSync.Common.dll

Local file storage operations used by AttachmentQueue. Implementations handle file I/O, directory management, and storage initialization.

public interface ILocalStorageAdapter

Methods

ClearAsync()

Clears all files in the storage.

CreateDirectoryAsync(string)

Creates a directory at the specified path. No-ops if it already exists.

DeleteFileAsync(string)

Deletes the file at the given path. No-ops if the file doesn't exist.

FileExistsAsync(string)

Checks if a file exists at the given path.

GetLocalUri(string)

Returns the file path for the provided filename in the storage directory.

InitializeAsync()

Initializes the storage adapter (e.g., creating necessary directories).

ReadFileAsync(string)

Opens a file for streaming reads.

RemoveDirectoryAsync(string)

Removes a directory and all its contents at the specified path.

SaveFileAsync(string, Stream)

Saves a stream to a local file.