updateFile

fun updateFile(api: StoreApi, fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): StoreFileStreamWriter

Updates an existing file.

Return

{@link StoreFileStreamWriter} instance prepared for writing

Parameters

api

reference to Store API

fileId

ID of the file to update

publicMeta

new public metadata for the matching file

privateMeta

new private (encrypted) metadata for the matching file

size

size of data to write

Throws

when {@code storeApi} is not initialized or there's no connection

if there is an error while updating Store file metadata

if there is an unknown error while updating Store file metadata


fun updateFile(api: StoreApi, fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long, source: Source, streamController: StoreFileStream.Controller? = null): String

Updates existing file and writes data from passed Source.

Return

Updated file ID

Parameters

api

reference to Store API

fileId

ID of the file to update

publicMeta

new public metadata for the matching file

privateMeta

new private (encrypted) metadata for the matching file

size

size of data to write

source

stream with data to write to the file using optimal chunk size StoreFileStream.OPTIMAL_SEND_SIZE

streamController

controls the process of writing file

Throws

IOException

if there is an error while reading stream or this is closed

when storeApi is not initialized or there's no connection

if there is an error while updating Store file metadata

if there is an unknown error while updating Store file metadata