Skip to main content

StreamingLocalStorageAdapter

Experimental Alpha

A LocalStorageAdapter that can relocate a file into managed storage without loading it into memory. Required for AttachmentQueue.saveFileFromUri; only queues configured with a streaming-capable local adapter expose that method.

This is currently experimental and may change without a major version bump.

Extends

Methods

clear()

clear(): Promise<void>;

Alpha

Clears all files in the storage.

Returns

Promise<void>

Inherited from

LocalStorageAdapter.clear


deleteFile()

deleteFile(filePath): Promise<void>;

Alpha

Deletes the file at the given path.

Parameters

ParameterTypeDescription
filePathstringPath where the file is stored

Returns

Promise<void>

Inherited from

LocalStorageAdapter.deleteFile


fileExists()

fileExists(filePath): Promise<boolean>;

Alpha

Checks if a file exists at the given path.

Parameters

ParameterTypeDescription
filePathstringPath where the file is stored

Returns

Promise<boolean>

True if the file exists, false otherwise

Inherited from

LocalStorageAdapter.fileExists


getLocalUri()

getLocalUri(filename): string;

Alpha

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

Parameters

ParameterTypeDescription
filenamestringThe filename to get the path for

Returns

string

The full file path

Inherited from

LocalStorageAdapter.getLocalUri


initialize()

initialize(): Promise<void>;

Alpha

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

Returns

Promise<void>

Inherited from

LocalStorageAdapter.initialize


makeDir()

makeDir(path): Promise<void>;

Alpha

Creates a directory at the specified path.

Parameters

ParameterTypeDescription
pathstringThe full path to the directory

Returns

Promise<void>

Inherited from

LocalStorageAdapter.makeDir


moveFile()

moveFile(sourceUri, targetUri): Promise<number>;

Alpha

Moves a file into managed storage without loading it into memory. Overwrites any existing file at the target. When source and target are the same path, this is a no-op that just reports the size.

Parameters

ParameterTypeDescription
sourceUristringPath of the existing file
targetUristringDestination path within managed storage

Returns

Promise<number>

Number of bytes in the moved file


readFile()

readFile(filePath): Promise<ArrayBuffer>;

Alpha

Retrieves file data as an ArrayBuffer.

Parameters

ParameterTypeDescription
filePathstringPath where the file is stored

Returns

Promise<ArrayBuffer>

ArrayBuffer containing the file data

Inherited from

LocalStorageAdapter.readFile


rmDir()

rmDir(path): Promise<void>;

Alpha

Removes a directory at the specified path.

Parameters

ParameterTypeDescription
pathstringThe full path to the directory

Returns

Promise<void>

Inherited from

LocalStorageAdapter.rmDir


saveFile()

saveFile(filePath, data): Promise<number>;

Alpha

Saves data to a local file.

Parameters

ParameterTypeDescription
filePathstringPath where the file will be stored
dataAttachmentDataData to store (ArrayBuffer, Blob, or string)

Returns

Promise<number>

Number of bytes written

Inherited from

LocalStorageAdapter.saveFile