JSProgressMonitor
Overview
This class is returned to the Servoy client from the FileProvider js_streamFilesFromServer or js_streamFilesToServer method It is used to monitor the uploads/downloads calling back a Servoy method that can then get the status of the transfer(s) It is called repeatedly by a Timer when scheduled with a fixed interval to callback the Servoy method provided.
Methods Summarized
Returns the number of bytes already transferred for the current file.
Returns the total bytes to transfer to or from the server (sum of all the files size)
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.
Methods Detailed
cancel()
Cancels the transfer process.
Returns: Boolean
Sample
getCurrentBytesToTransfer()
Returns the number of bytes to transfer for the current file.
Returns: Number
Sample
getCurrentFileIndex()
Returns the index of the current file being transferred.
Returns: Number
Sample
getCurrentTransferredBytes()
Returns the number of bytes already transferred for the current file.
Returns: Number
Sample
getCurrentTransferredFileName()
Returns the name of the current file being transferred.
Returns: String
Sample
getTotalBytesToTransfer()
Returns the total bytes to transfer to or from the server (sum of all the files size)
Returns: Number
Sample
getTotalFilesToTransfer()
Returns the total number of files to transfer.
Returns: Number
Sample
getTotalTransferredBytes()
Returns the total bytes already transferred (for all files)
Returns: Number
Sample
isCanceled()
Returns true if the process was canceled.
Returns: Boolean
Sample
isFinished()
Returns true if the process is finished.
Returns: Boolean
Sample
setProgressCallBack(function, interval)
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values. Can use an optional delay (for testing purpose in developer).
Parameters
Function function the Function to call back at the specified interval
Number interval the interval (in seconds) to use
Returns: JSProgressMonitor this for chaining
Sample
setProgressCallBack(function, interval, delay)
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values. Can use an optional delay (for testing purpose in developer).
Parameters
Function function the Function to call back at the specified interval
Number interval the interval (in seconds) to use
Number delay adds a delay for testing purpose in Developer
Returns: JSProgressMonitor this for chaining
Sample
Last updated
Was this helpful?