title | description |
---|---|
hive |
The Hive javascript API. |
This plugin defines a global cordova.hivePlugin
object, which provides an API for hive library.
Although in the global scope, it is not available until after the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(hivePlugin);
}
cordova plugin add elastos-cordova-plugin-hive
- Android
- iOS
Kind: global class
The class representing File.
Get the information(ID, name size, type) of the file got last time.
Kind: instance method of File
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
Get the information(ID, name, size, type) of the file from the server.
Kind: instance method of File
Returns: A promise object that contains the information(ID, name, size, type) of the file
will be returned on success, otherwise a promise object that contains error
information will be returned.
Move to a new path.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
destPath | string |
The new path. |
Copy to a new path.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
newPath | string |
The new path. |
Delete.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Read data of a specified length sequentially.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
length | number |
The length of data to write. |
Write local change on File.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
data | string |
The data to write. |
Commit local change on File to backend.
Kind: instance method of File
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Discard local change on File.
Kind: instance method of File
Returns: onSuccess will be called on success.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
Kind: global class
The class representing Directory.
Get the information(ID, name, childCount) of the directory got last time.
Kind: instance method of Directory
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
Get the information(ID, name, childCount) of the directory from the server.
Kind: instance method of Directory
Returns: A promise object that contains the information(ID, name, childCount) of the file
will be returned on success, otherwise a promise object that contains error
information will be returned.
Create directory with name.
Kind: instance method of Directory
Returns: A directory will be returned on success, otherwise a promise object that contains
error information will be returned.
Param | Type | Description |
---|---|---|
name | string |
The directory name. |
Get the directory with a specified name.
Kind: instance method of Directory
Returns: A directory will be returned on success, otherwise a promise object that contains
error information will be returned.
Param | Type | Description |
---|---|---|
name | string |
The directory name. |
Create file with name.
Kind: instance method of Directory
Returns: A file will be returned on success, otherwise a promise object that contains
error information will be returned.
Param | Type | Description |
---|---|---|
name | string |
The file name. |
Get the File with a specified name.
Kind: instance method of Directory
Returns: A file will be returned on success, otherwise a promise object that contains
error information will be returned.
Param | Type | Description |
---|---|---|
name | string |
The file name. |
Get children for current directory.
Kind: instance method of Directory
Returns: The children for current directory will be returned on success, otherwise
a promise object that contains error information will be returned.
Move to a new path.
Kind: instance method of Directory
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
destPath | string |
The destination path. |
Copy to a new path.
Kind: instance method of Directory
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Param | Type | Description |
---|---|---|
newPath | string |
The new path. |
Delete.
Kind: instance method of Directory
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Kind: global class
The class representing Drive.
Get the information(ID) of the drive got last time.
Kind: instance method of Drive
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
Get the information(ID) of the drive from the server.
Kind: instance method of Drive
Returns: A promise object that contains the information(ID) of the file
will be returned on success, otherwise a promise that contains error information
will be returned.
Get the root directory.
Kind: instance method of Drive
Returns: A directory will be returned on success, otherwise a promise that contains
error information will be returned.
Create directory with path.
Kind: instance method of Drive
Returns: A directory will be returned on success, otherwise a promise that contains
error information will be returned.
Param | Type | Description |
---|---|---|
path | string |
The directory path. |
Get the directory with a specified path.
Kind: instance method of Drive
Returns: A directory will be returned on success, otherwise a promise that contains
error information will be returned.
Param | Type | Description |
---|---|---|
path | string |
The directory path. |
Create file with path.
Kind: instance method of Drive
Returns: A file will be returned on success, otherwise a promise that contains
error information will be returned.
Param | Type | Description |
---|---|---|
path | string |
The file path. |
Get the File with a specified path.
Kind: instance method of Drive
Returns: A file will be returned on success, otherwise a promise that contains
error information will be returned.
Param | Type | Description |
---|---|---|
path | string |
The file path. |
Get the information(ID, name, size, type) of the drive with a specified path.
Kind: instance method of Drive
Returns: A promise object that contains success information will be returned on success,
otherwise a promise that contains error information will be returned.
Param | Type | Description |
---|---|---|
path | string |
The drive path. |
Kind: global class
The class representing Client.
Associate a user with the Client.
Kind: instance method of Client
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
handler | function |
The function to call. |
Dissociate the user from the Client.
Kind: instance method of Client
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
Get the last associated user's information with client information.
Kind: instance method of Client
Returns: onSuccess will be called on success, otherwise onError will be called.
Param | Type | Description |
---|---|---|
onSuccess | function |
The function to call on success. |
onError | function |
The function to call on error. |
Get associated user's information with client information.
Kind: instance method of Client
Returns: A promise object that contains success information will be returned on success,
otherwise a promise object that contains error information will be returned.
Get the current backend's Drive instance associated with the client's drive.
Kind: instance method of Client
Returns: A drive will be returned on success, otherwise a promise object that contains
error information will be returned.