- Tutorials:
Global object to browse NFS servers.
Exists only on supported devices.
Methods
(static) findServers(callback)
Start scanning to find all available servers.
Example
stbNfs.findServers(function ( error, data ) {
if ( !error ) {
// list of found servers:
// ['192.168.0.8']
console.log(data);
}
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
stbNfs~findServersCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
(static) findShares(config, callback)
Start scanning to find all available exports on the given server.
A server IP can be obtained with stbNfs.findServers
.
Example
stbNfs.findShares({server: '192.168.0.8'}, function ( error, data ) {
if ( !error ) {
// list of found shares:
// ['video', 'music']
console.log(data);
}
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
config |
Object | scan configuration Properties
|
||||||
callback |
stbNfs~findSharesCallback | scan result handler |
Throws:
Will throw an error in case of bad input arguments.
Type Definitions
ErrorResultObject
Properties:
Name | Type | Description |
---|---|---|
message |
string | error description |
code |
number | error code |
Error result object.
Type:
- Object
Example
{
message: 'some error occurred',
code: -1,
}
findServersCallback(error, data)
Servers scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
stbNfs~ErrorResultObject | null | scan error message on failure |
data |
Array.<string> | found server list |
findSharesCallback(error, data)
Shares scan result handler.
Parameters:
Name | Type | Description |
---|---|---|
error |
stbNfs~ErrorResultObject | null | scan error message on failure |
data |
Array.<string> | export directory name list |