setOnFile

abstract fun setOnFile(onFileHandler: OnFileHandler?)

Sets the handler for incoming file events. This method allows the assignment of an OnFileHandler implementation or lambda expression to handle incoming presence events.

To deactivate the current behavior, simply set this property to null.

Note that this property allows for the assignment of a singular behavior at a time, as any new assignment will override the previous one. For scenarios requiring multiple behaviors in response to file events, it is advisable to utilize EventEmitter.addListener.

Setting a Behavior Example:

`onFileHandler(pnFileEventResult -> System.out.println("Received: " +  pnFileEventResult.getMessage()));
`
*

Removing a Behavior Example:

`onFileHandler(null);
`
*

Parameters

onFileHandler

An implementation of OnFileHandler or a lambda expression to handle incoming messages. It can be null to remove the current handler.