kvision / pl.treksoft.kvision.cordova / FileEntry

FileEntry

external interface FileEntry : Entry

Inherited Properties

filesystem

abstract var filesystem: FileSystem

fullPath

abstract var fullPath: String

isDirectory

abstract var isDirectory: Boolean

isFile

abstract var isFile: Boolean

name

abstract var name: String

Functions

createWriter

abstract fun createWriter(successCallback: FileWriterCallback, errorCallback: ErrorCallback? = definedExternally): Unit

file

abstract fun file(successCallback: FileCallback, errorCallback: ErrorCallback? = definedExternally): Unit

Inherited Functions

copyTo

abstract fun copyTo(parent: DirectoryEntry, newName: String? = definedExternally, successCallback: EntryCallback? = definedExternally, errorCallback: ErrorCallback? = definedExternally): Unit

getMetadata

abstract fun getMetadata(successCallback: MetadataCallback, errorCallback: ErrorCallback? = definedExternally): Unit

getParent

abstract fun getParent(successCallback: DirectoryEntryCallback, errorCallback: ErrorCallback? = definedExternally): Unit

moveTo

abstract fun moveTo(parent: DirectoryEntry, newName: String? = definedExternally, successCallback: EntryCallback? = definedExternally, errorCallback: ErrorCallback? = definedExternally): Unit

remove

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

toInternalURL

abstract fun toInternalURL(): String

toURL

abstract fun toURL(): String

Extension Functions

append

suspend fun FileEntry.append(data: <ERROR CLASS>): Result<FileEntry, FileException>

Append file content from a Blob.

suspend fun FileEntry.append(data: String): Result<FileEntry, FileException>

Append file content from a plain string.

copyTo

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

Copy given file or directory to a new location.

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.

createWriter

suspend fun FileEntry.createWriter(): Result<FileWriter, FileException>

Create a FileWriter object for a given file entry.

file

suspend fun FileEntry.file(): Result<File, FileException>

Get a File object for a given file entry.

getMetadata

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

Get file or directory metadata.

getParent

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

Get file or directory parent directory entry.

moveTo

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

Move given file or directory to a new location.

readAsArrayBuffer

suspend fun FileEntry.readAsArrayBuffer(): Result<<ERROR CLASS>, FileException>

Read file content as an array buffer.

readAsDataURL

suspend fun FileEntry.readAsDataURL(): Result<String, FileException>

Read file content as a data url.

readAsText

suspend fun FileEntry.readAsText(): Result<String, FileException>

Read file content as a plain string.

remove

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

Remove given file or directory.

write

suspend fun FileEntry.write(data: <ERROR CLASS>): Result<FileEntry, FileException>

Write file content from a Blob.

suspend fun FileEntry.write(data: String): Result<FileEntry, FileException>

Write file content from a plain string.

writeDataUrL

suspend fun FileEntry.writeDataUrL(dataUrl: String): Result<FileEntry, FileException>

Write file content from a data url.