PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Store

StoreFileStreamWriter

Manages handle for file writing.

Static Methods

createFile

Creates a new file in given Store.

Params

api

StoreApi

reference to Store API

storeId

String

ID of the Store

publicMeta

byte[]

byte array of any arbitrary metadata that can be read by anyone

privateMeta

byte[]

byte array of any arbitrary metadata that will be encrypted before sending

size

long

size of data to write

public static StoreFileStreamWriter createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

Returns

StoreFileStreamWriter · Instance ready to write to the created Store file

createFile

Creates a new file in given Store and writes data from given InputStream.

Params

api

StoreApi

reference to Store API

storeId

String

ID of the Store

publicMeta

byte[]

byte array of any arbitrary metadata that can be read by anyone

privateMeta

byte[]

byte array of any arbitrary metadata that will be encrypted before sending

size

long

size of data to write

inputStream

InputStream

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

public static String createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream
)

Returns

String · ID of the created file

createFile

Creates new file in given Store and writes data from given InputStream.

Params

api

StoreApi

reference to Store API

storeId

String

ID of the Store

publicMeta

byte[]

byte array of any arbitrary metadata that can be read by anyone

privateMeta

byte[]

byte array of any arbitrary metadata that will be encrypted before sending

size

long

size of data to write

inputStream

InputStream

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

streamController

Controller

controls the process of writing file

public static String createFile(
StoreApi api,
String storeId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream,
Controller streamController
)

Returns

String · ID of the created file

updateFile

Updates an existing file.

Params

api

StoreApi

reference to Store API

fileId

String

ID of the file to update

publicMeta

byte[]

new public metadata for the matching file

privateMeta

byte[]

new private (encrypted) metadata for the matching file

size

long

size of data to write

public static StoreFileStreamWriter updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size
)

Returns

StoreFileStreamWriter · StoreFileStreamWriter instance prepared for writing

updateFile

Updates existing file and writes data from passed InputStream.

Params

api

StoreApi

reference to Store API

fileId

String

ID of the file to update

publicMeta

byte[]

new public metadata for the matching file

privateMeta

byte[]

new private (encrypted) metadata for the matching file

size

long

size of data to write

inputStream

InputStream

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

public static String updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream
)

Returns

String · Updated file ID

updateFile

Updates existing file and writes data from passed InputStream.

Params

api

StoreApi

reference to Store API

fileId

String

ID of the file to update

publicMeta

byte[]

new public metadata for the matching file

privateMeta

byte[]

new private (encrypted) metadata for the matching file

size

long

size of data to write

inputStream

InputStream

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

streamController

Controller

controls the process of writing file

public static String updateFile(
StoreApi api,
String fileId,
byte[] publicMeta,
byte[] privateMeta,
long size,
InputStream inputStream,
Controller streamController
)

Returns

String · Updated file ID

Methods

write

Writes data to Store file.

Params

data

byte[]

data to write (the recommended size of data chunk is StoreFileStream#OPTIMAL_SEND_SIZE)

public void write(
byte[] data
)

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.