FileStore

class FileStore(context: Context)

FileStore file manager responsible for storing and providing info about files.

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
fun downloadFile(fileUrl: String, inputStream: InputStream): String

Save file in cache

Link copied to clipboard
fun getMime(uri: Uri): String?

Return the MIME type of the given URI.

fun getMime(file: File): String?

Return the MIME type based on the File object. This method tries to determine the MIME type using the ContentResolver for URIs, and if that fails, it falls back to using MimeTypeMap with the file extension.

fun getMime(path: String): String?

Return the MIME type based on the file path. This function first attempts to determine the MIME type based on the URI. If that fails, it falls back to determining the MIME type based on the file extension.

Link copied to clipboard

return name of file

Link copied to clipboard
fun sizeInKb(file: File): Double

The function return size of the file in KB

Link copied to clipboard
fun writeTextToFile(filename: String, data: String): String

Write a file in cache