DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
getCurrentBytesToTransfer()
Returns the number of bytes to transfer for the current file.
getCurrentFileIndex()
Returns the index of the current file being transferred.
getCurrentTransferredBytes()
Returns the number of bytes already transferred for the current file.
getCurrentTransferredFileName()
Returns the name of the current file being transferred.
getTotalBytesToTransfer()
Returns the total bytes to transfer to or from the server (sum of all the files size)
getTotalFilesToTransfer()
Returns the total number of files to transfer.
getTotalTransferredBytes()
Returns the total bytes already transferred (for all files)
isCanceled()
Returns true if the process was canceled.
isFinished()
Returns true if the process is finished.
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.
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.
{column:width=100%|padding=0px}{column}
Method Details
cancel
()
Cancels the transfer process.
Sample
monitor.cancel();
getCurrentBytesToTransfer
()
Returns the number of bytes to transfer for the current file.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getCurrentFileIndex
()
Returns the index of the current file being transferred.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getCurrentTransferredBytes
()
Returns the number of bytes already transferred for the current file.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getCurrentTransferredFileName
()
Returns the name of the current file being transferred.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getTotalBytesToTransfer
()
Returns the total bytes to transfer to or from the server (sum of all the files size)
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getTotalFilesToTransfer
()
Returns the total number of files to transfer.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
getTotalTransferredBytes
()
Returns the total bytes already transferred (for all files)
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
isCanceled
()
Returns true if the process was canceled.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
isFinished
()
Returns true if the process is finished.
Sample
application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') }
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).
Sample
// call the progressCallbackFuntion every 2 and a half seconds (with a delay of 200ms in developer): monitor.setProgressCallBack(progressCallbackFunction, 2.5, (application.isInDeveloper() ? 200 : 0));
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).
Sample
// call the progressCallbackFuntion every 2 and a half seconds (with a delay of 200ms in developer): monitor.setProgressCallBack(progressCallbackFunction, 2.5, (application.isInDeveloper() ? 200 : 0));