StorageHelperWrapper

class StorageHelperWrapper(context: Context, storageHelper: StorageHelper, attachmentFilter: AttachmentFilter)

Wrapper around the StorageHelper class, with some extra functionality that makes it easier to decouple the business logic and make it consistent.

Parameters

context

The context of the app, used to fetch files and media.

storageHelper

The storage helper that provides all the logic required to work with the system storage.

attachmentFilter

A filter that is used to filter out attachments that will not be accepted by the backend.

Constructors

Link copied to clipboard
constructor(context: Context, storageHelper: StorageHelper, attachmentFilter: AttachmentFilter)

Functions

Link copied to clipboard

Transforms a list of AttachmentMetaData into a list of Attachments. This is required because we need to prepare the files for upload.

Link copied to clipboard

Takes a list of file Uris and transforms them into a list of Attachments so that we can upload them.

Link copied to clipboard

Takes a list of file Uris and transforms them into a list of AttachmentMetaData.

Link copied to clipboard

Loads a list of file metadata from the system and filters it against file types accepted by the backend.

Link copied to clipboard

Loads a list of media metadata from the system.