Class: FileConnector

FileConnector((string[]))

Defines the FileConnector to read a File content

Constructor

new FileConnector((string[]))

Parameters:
Name Type Description
(string[]) paths - list of file paths
Source:
Example
import FileConnector from 'core/protocol/FileConnector.js';

let paths = ['path1','path2]...];
let protocol = new FileConnector(paths);

// connect
protocol.connect();

// disconnect
protocol.disconnect();

// close
protocol.close();

Extends

Methods

checkStatus(status)

Check a change of the status and call the corresponding callbacks if necessary
Parameters:
Name Type Description
status Status the currentStatus
Overrides:
Source:

(async) connect()

Start reading file content
Source:

getId() → {String}

The data protocol default id.
Overrides:
Source:
Returns:
Type
String

getUrl() → {String}

The stream url.
Overrides:
Source:
Returns:
Type
String

onChangeStatus(status)

Called when the connection STATUS changes
Parameters:
Name Type Description
status Status the new status
Overrides:
Source:

onConnect()

Called when the protocol has been connected
Overrides:
Source:

onDisconnect()

Called when the protocol has been disconnected
Overrides:
Source:

setReconnectTimeout(timeout)

Sets the reconnection timeout
Parameters:
Name Type Description
timeout Number delay in milliseconds before reconnecting dataSource
Overrides:
Source:

setUrl(url)

Sets the url
Parameters:
Name Type Description
url
Overrides:
Source: