KaliumFileSystem

Properties

Link copied to clipboard
abstract val rootCachePath: Path

Provides the root of the cache path, used to store temporary files

Link copied to clipboard
abstract val rootDBPath: Path

Provides the root of the current user database path, used to store all the Database information.

Functions

Link copied to clipboard
abstract fun copy(sourcePath: Path, targetPath: Path)

Copies effectively the content of sourcePath into targetPath

Link copied to clipboard
abstract fun createDirectories(dir: Path)

It will create the provided dir in the current file system along with the needed subdirectories if they were not created previously

Link copied to clipboard
abstract fun createDirectory(dir: Path, mustCreate: Boolean = false)

It will make sure the given dir gets created on the file system

Link copied to clipboard
abstract fun delete(path: Path, mustExist: Boolean = false)

This will delete the content of the given file path

Link copied to clipboard
abstract fun deleteContents(dir: Path, mustExist: Boolean = false)

This will delete recursively the given dir and all its content

Link copied to clipboard
abstract fun exists(path: Path): Boolean

Checks whether the given path is already created and exists on the current file system

Link copied to clipboard
abstract suspend fun listDirectories(dir: Path): List<Path>

Provides a list of paths found in the given dir path from where the call is being invoked.

Link copied to clipboard
abstract fun providePersistentAssetPath(assetName: String): Path

Creates a persistent path on the internal storage folder of the file system if it didn't exist before and returns it if successful

Link copied to clipboard
abstract suspend fun readByteArray(inputPath: Path): ByteArray

Reads the data of the given path as a byte array

Link copied to clipboard
abstract fun selfUserAvatarPath(): Path

Fetches the persistent Path of the current user's avatar in the KaliumFileSystem

Link copied to clipboard
abstract fun sink(outputPath: Path, mustCreate: Boolean = false): Sink

Opens an output stream that will be used to write the data on the given outputPath

Link copied to clipboard
abstract fun size(path: Path): Long?
Link copied to clipboard
abstract fun source(inputPath: Path): Source

Creates an input stream that will be used to read the data from the given inputPath

Link copied to clipboard
abstract fun tempFilePath(pathString: String? = null): Path

Creates a temporary path if it didn't exist before and returns it if successful.

Link copied to clipboard
abstract suspend fun writeData(outputSink: Sink, dataSource: Source): Long

Writes the data contained on dataSource into the provided outputSink