PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Core

EntryStreamListener

Interface for listening to state changes and exchanging data with an InboxEntryStream instance.

This interface provides callbacks for various events that occur during the lifecycle of an Inbox entry stream, such as starting and ending file sending, requesting file chunks, handling errors, and updating the stream state.

Implement this interface to monitor and interact with the entry stream.

Constructors

EntryStreamListener

public void EntryStreamListener()

Methods

onEndFileSending

Override this method to handle when file was sent successfully.

Params

file

FileInfo

information about the sent file

public void onEndFileSending(
FileInfo file
)

onError

Override this method to handle event when an error occurs while creating entry.

Params

throwable

Throwable

exception that occurred while creating an entry

public void onError(
Throwable throwable
)

onErrorDuringSending

Override this method to handle event when an error occurs while sending files.

Params

file

FileInfo

information about the file that caused the error

throwable

Throwable

exception that occurred while sending files

public void onErrorDuringSending(
FileInfo file,
Throwable throwable
)

onFileChunkProcessed

Override this method to handle event when each chunk of a file was sent successfully.

Params

file

FileInfo

information about the file, which chunk was processed

processedBytes

long

accumulated size of sent data

public void onFileChunkProcessed(
FileInfo file,
long processedBytes
)

onNextChunkRequest

Override this method to handle event when FileInfo#fileStream is null and the stream requests a chunk of the file to send. If you override this method, you should return the next chunk of the file. Returning null will cause a NullPointerException while sending the file and stop the InboxEntryStream instance with the state State#ERROR.

Params

file

FileInfo

info about the file, which chunk is requested

public byte[] onNextChunkRequest(
FileInfo file
)

Returns

byte[] · next chunk of the file

onStartFileSending

Override this method to handle when the process of sending file starts.

Params

file

FileInfo

information about the file being sent

public void onStartFileSending(
FileInfo file
)

onUpdateState

Override this method to handle event when stream state has been updated.

Params

currentState

State

current state of the stream

public void onUpdateState(
State currentState
)

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

EntryStreamListener | PrivMX Docs