Constructor
new Connect(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Configuration parameters for Connect Properties
|
Methods
addEventListener(type, listener) → {null|Error}
Subscribe for Connect events. The first time the listener is called it will receive an event for each of the transfers already displayed in Connect, such that the listener will know the complete state of all transfers.
Parameters:
Name | Type | Description |
---|---|---|
type |
EVENT |
The type of event to receive events for. |
listener |
function |
The function that will be called when the event occurs. Format:
"transfer" event types return data format: AllTransfersInfo |
Example
// create a transfer listener
function transferListener(type, allTransfersInfo) {
if (type === AW4.Connect.EVENT.TRANSFER) {
console.log('Received transfer event!')
handleTransferEvent(allTransfersInfo) // do something with the transfers data
}
}
asperaWeb.addEventListener(AW4.Connect.EVENT.TRANSFER, transferListener)
authenticate(authSpec, callbacks) → {null|Error}
Test authentication credentials against a transfer server.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
authSpec |
Object |
Authentication credentials. Options for
|
callbacks |
Callbacks |
Object returned to success callback:
|
getAllTransfers(callbacks, iterationTokenopt) → {null}
Get statistics for all transfers.
This method is asynchronous.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
|
||
iterationToken |
String |
<optional> |
'0' |
If specified, return only transfers that have had activity since the last call. |
getChecksum(options, callbacks) → {null}
Calculates checksum of the given chunk size of the file.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Object with options needed for reading a chunk. Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
getDroppedFiles(data, callbacks) → {null|Error}
Gets drag and drop files. Please note that the dragDropEnabled
option must have been set to true
when creating the AW4.Connect object.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
data |
DragDropDataTransfer |
Data transfer object. |
callbacks |
Callbacks |
Error and Success callbacks. |
getStatus() → {STATUS}
Get current status of Connect.
getTransfer(transferId, callbacks) → {null}
Get statistics for a single transfer.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID ( |
callbacks |
Callbacks |
Object returned to success callback:
See
|
initSession(applicationIdopt) → {Object}
Call this method after creating the AW4.Connect object. It is mandatory to call this function before making use of any other function of the API. If called more than once on the same instance, it will return an error.
Return format:
{
"app_id": "MjY2ZTM0YWItMGM2NC00ODdhLWJkNzQtNzU0YzVjN2FjYjJj"
}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
applicationId |
String | Undefined |
<optional> |
An ID to represent this session. Transfers initiated during this session will be associated with the ID. To continue a previous session, use the same ID as before. Use a unique ID in order to keep transfer information private from other websites. IF not specified, an ID is automatically generated for you. |
modifyTransfer(transferId, options, callbacks) → {null}
Change the speed of a running transfer.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID of the transfer to modify |
options |
Object |
A subset of TransferSpec Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
readAsArrayBuffer(options, callbacks) → {null|Error}
Read file as 64-bit encoded data.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Object with options needed for reading the file. Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
readChunkAsArrayBuffer(options, callbacks) → {null|Error}
Read 64-bit encoded chunk from file.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Object with options needed for reading a chunk. Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
removeEventListener(typeopt, listeneropt) → {Boolean}
Unsubscribe from Aspera Web events. If type
is not specified,
all versions of the listener
with different types will be removed.
If listener
is not specified, all listeners for the type
will be
removed. If neither type
nor listener
are specified, all listeners
will be removed.
Return values:
true
- If we could find a listener with the parameters provided.false
- If we could not find a listener for the parameters provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
EVENT |
<optional> |
The type of event to stop receiving events for. |
listener |
function |
<optional> |
The function used to subscribe in AW4.Connect#addEventListener |
removeTransfer(transferId, callbacks) → {null}
Remove the transfer - terminating it if necessary - from Connect.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID( |
callbacks |
Callbacks |
Object returned to success callback:
|
resumeTransfer(transferId, options, callbacks) → {null}
Resume a transfer that was stopped.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID( |
options |
Object |
A subset of TransferSpec Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
setDragDropTargets(cssSelector, optionsopt, listener) → {null|Error}
Sets drag and drop options for the element given in the cssSelector. Please note that
the dragDropEnabled
option must have been set to true
when creating the AW4.Connect
object.
This method is asynchronous.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cssSelector |
String |
CSS selector for drop targets. |
|
options |
Object |
<optional> |
Drag and drop options for these targets. Options:
|
listener |
function |
Function to be called when each of the events occurs. Format:
|
showAbout(callbacks) → {null}
Displays the IBM Aspera Connect "About" window.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
|
showDirectory(transferId, callbacks) → {null}
Open the destination directory of the transfer using the system file browser.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID( |
callbacks |
Callbacks |
Object returned to success callback:
|
showPreferences(callbacks) → {null}
Displays the IBM Aspera Connect "Preferences" window.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
|
showPreferencesPage(options, callbacks) → {null}
Displays the IBM Aspera Connect "Preferences" window opened to a specifiic page.
This method is asynchronous
Parameters:
Name | Type | Description |
---|---|---|
options |
options |
Options used when opening preferences. Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
showSaveFileDialog(callbacks, optionsopt) → {null|Error}
Displays a file chooser dialog for the user to pick a "save-to" path.
This method is asynchronous.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
See |
|
options |
Object |
<optional> |
File chooser options Options:
|
showSelectFileDialog(callbacks, optionsopt) → {null|Error}
Displays a file browser dialog for the user to select files. The select file dialog call(s) may be separated in time from the later startTransfer(s) call, but they must occur in the same Connect session.
This method is asynchronous.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
See |
|
options |
Object |
<optional> |
File chooser options Options:
|
showSelectFileDialogPromise(optionsopt) → {Promise.<dataTransfer>}
Displays a file browser dialog for the user to select files. The select file dialog call(s) may be separated in time from the later startTransfer(s) call, but they must occur in the same Connect session.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
File chooser options Options:
|
showSelectFolderDialog(callbacks, optionsopt) → {null|Error}
Displays a file browser dialog for the user to select directories. The select folder dialog call(s) may be separated in time from the later startTransfer(s) call, but they must occur in the same Connect session.
This method is asynchronous.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
See |
|
options |
Object |
<optional> |
File chooser options Options:
|
showSelectFolderDialogPromise(optionsopt) → {Promise.<dataTransfer>}
Displays a file browser dialog for the user to select directories. The select folder dialog call(s) may be separated in time from the later startTransfer(s) call, but they must occur in the same Connect session.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
File chooser options Options:
|
showTransferManager(callbacks) → {null}
Displays the IBM Aspera Connect "Activity" window.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
|
showTransferMonitor(transferId, callbacks) → {null}
Displays the IBM Aspera Connect "Transfer Monitor" window for the transfer.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID( |
callbacks |
Callbacks |
Object returned to success callback:
|
start() → {null|Error}
Start looking for Connect. Please note that this is called internally by AW4.Connect#initSession and it should only be called directly after a call to AW4.Connect#stop.
startTransfer(transferSpec, connectSpec, callbacks) → {Object|Error}
Initiates a single transfer. Call AW4.Connect#getAllTransfers to get transfer statistics, or register an event listener through AW4.Connect#addEventListener.
Return format:
{
"request_id": "bb1b2e2f-3002-4913-a7b3-f7aef4e79132"
}
The request_id
, which is returned immediately, may be used for matching
this transfer with its events.
Parameters:
Name | Type | Description |
---|---|---|
transferSpec |
TransferSpec |
Transfer parameters. |
connectSpec |
ConnectSpec |
Connect options |
callbacks |
Callbacks |
Object returned to success callback:
|
startTransferPromise(transferSpec, connectSpec) → {Promise.<TransferSpecs>}
Initiates a single transfer. Call AW4.Connect#getAllTransfers to get transfer statistics, or register an event listener through AW4.Connect#addEventListener.
Parameters:
Name | Type | Description |
---|---|---|
transferSpec |
TransferSpec |
Transfer parameters. |
connectSpec |
ConnectSpec |
Connect options |
startTransfers(transferSpecs, callbacks) → {Object|Error}
Initiates one or more transfers (currently only the first transfer_spec
is used). It's recommended to instead use AW4.Connect#startTransfer. Call AW4.Connect#getAllTransfers to get transfer
statistics, or register an event listener through AW4.Connect#addEventListener.
This method is asynchronous.
Return format:
{
"request_id": "bb1b2e2f-3002-4913-a7b3-f7aef4e79132"
}
The request_id
, which is returned immediately, may be used for matching
this transfer with its events.
Parameters:
Name | Type | Description |
---|---|---|
transferSpecs |
Object |
Transfer parameters. Format: See TransferSpecs |
callbacks |
Callbacks |
Object returned to success callback: TransferSpecs |
stop() → {Boolean}
Stop all requests from Connect to restart activity, please create a new AW4.Connect object or call AW4.Connect#start.
stopTransfer(transferId, callbacks) → {null}
Terminate the transfer. Use AW4.Connect#resumeTransfer to resume.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
transferId |
String |
The ID( |
callbacks |
Callbacks |
Object returned to success callback:
|
testSshPorts(options, callbacks) → {null}
Test that Connect can open a TCP connection to remote_host
over the given ssh_port
.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Test options. Options:
|
callbacks |
Callbacks |
Object returned to success callback:
|
version(callbacks) → {null}
Get the IBM Aspera Connect version and installation context.
This method is asynchronous.
Parameters:
Name | Type | Description |
---|---|---|
callbacks |
Callbacks |
Object returned to success callback:
|