StorageHelper

Helper class for managing file and media attachments from device storage.

This class provides utilities to:

  • Query files and media from the device's MediaStore

  • Cache remote or content URI files to local storage

  • Parse attachment metadata from content URIs

The class uses Android's MediaStore API to retrieve file information and should be called from a background thread when querying large datasets to avoid blocking the main thread.

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Queries a list of content URIs and returns parsed attachment metadata for each.

Link copied to clipboard
fun getCachedFileFromUri(context: Context, attachmentMetaData: AttachmentMetaData): File?

Retrieves or creates a cached copy of a file from the given attachment metadata.

Link copied to clipboard

Retrieves all file attachments from the device's external storage.

Link copied to clipboard

Retrieves all media attachments (images and videos) from the device's external storage.