StreamFileUtil

Functions

Link copied to clipboard
fun clearStreamCache(context: Context): Result<Unit>

Deletes all the content contained within the Stream cache directory.

Link copied to clipboard
fun getFileFromCache(context: Context, attachment: Attachment): Result<Uri>

Fetches the given attachment from cache if it has been previously cached. Returns an error otherwise.

Link copied to clipboard
fun getUriForFile(context: Context, file: File): Uri
Link copied to clipboard
suspend fun writeFileToShareableFile(context: Context, attachment: Attachment): Result<Uri>

Hashes the links of given attachments and then tries to create a new file under that hash. If the file already exists checks that the full file has been written and shares it if it has, in other cases downloads the file and writes it.

Link copied to clipboard
fun writeImageToSharableFile(context: Context, bitmap: Bitmap): Uri?