kvision / pl.treksoft.kvision.cordova / DirectoryEntry

DirectoryEntry

(js) interface DirectoryEntry : Entry

Functions

(js)

createReader

abstract fun createReader(): DirectoryReader
(js)

getDirectory

abstract fun getDirectory(path: String, options: Flags? = definedExternally, successCallback: DirectoryEntryCallback?, errorCallback: ErrorCallback? = definedExternally): Unit
(js)

getFile

abstract fun getFile(path: String, options: Flags? = definedExternally, successCallback: FileEntryCallback?, errorCallback: ErrorCallback? = definedExternally): Unit
(js)

removeRecursively

abstract fun removeRecursively(successCallback: VoidCallback, errorCallback: ErrorCallback? = definedExternally): Unit

Extension Functions

(js)

copyTo

Copy given file or directory to a new location.

suspend fun Entry.copyTo(parent: DirectoryEntry, newName: String? = null): Result<Entry, FileException>
(js)

getDirectory

Get or create a directory in a given parent directory.

suspend fun DirectoryEntry.getDirectory(path: String, create: Boolean = true, exclusive: Boolean = false): Result<DirectoryEntry, FileException>
(js)

getFile

Get or create a file in a given parent directory.

suspend fun DirectoryEntry.getFile(path: String, create: Boolean = true, exclusive: Boolean = false): Result<FileEntry, FileException>
(js)

getMetadata

Get file or directory metadata.

suspend fun Entry.getMetadata(): Result<Metadata, FileException>
(js)

getParent

Get file or directory parent directory entry.

suspend fun Entry.getParent(): Result<DirectoryEntry, FileException>
(js)

moveTo

Move given file or directory to a new location.

suspend fun Entry.moveTo(parent: DirectoryEntry, newName: String? = null): Result<Entry, FileException>
(js)

readEntries

List directory entries for a given parent directory entry.

suspend fun DirectoryEntry.readEntries(): Result<List<Entry>, FileException>
(js)

remove

Remove given file or directory.

suspend fun Entry.remove(): Result<Entry, FileException>
(js)

removeRecursively

Remove given directory recursively.

suspend fun DirectoryEntry.removeRecursively(): Result<DirectoryEntry, FileException>