Skip to main content

Work in progress

PrivMX Endpoint Java is not up to date with the core documentation. Some of the features you've seen described in other parts of the documentation might not be mentioned here. Those changes do not influence compatibility, however

Downloading Files

Downloading file content and accessing files.

Downloading a file from the Store and saving it by chunk to ByteArray:

val fileID = "FILE_ID"
val storeApi = connection.storeApi
var data = ByteArray(0)

val closedFileID = StoreFileStreamReader.openFile(
storeApi,
fileID,
).also {
do {
val chunk = it.read(StoreFileStream.OPTIMAL_SEND_SIZE)
data += chunk
} while (chunk.size.toLong() == StoreFileStream.OPTIMAL_SEND_SIZE)
}.close()