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
deleteFile()
deleteFile(filePath): Promise<void>;
Alpha
Deletes the file at the given path.
Parameters
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path 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
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path 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
| Parameter | Type | Description |
|---|---|---|
filename | string | The 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
| Parameter | Type | Description |
|---|---|---|
path | string | The full path to the directory |
Returns
Promise<void>
Inherited from
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
| Parameter | Type | Description |
|---|---|---|
sourceUri | string | Path of the existing file |
targetUri | string | Destination 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
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path where the file is stored |
Returns
Promise<ArrayBuffer>
ArrayBuffer containing the file data
Inherited from
rmDir()
rmDir(path): Promise<void>;
Alpha
Removes a directory at the specified path.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | The full path to the directory |
Returns
Promise<void>
Inherited from
saveFile()
saveFile(filePath, data): Promise<number>;
Alpha
Saves data to a local file.
Parameters
| Parameter | Type | Description |
|---|---|---|
filePath | string | Path where the file will be stored |
data | AttachmentData | Data to store (ArrayBuffer, Blob, or string) |
Returns
Promise<number>
Number of bytes written