commandbox.system.util

Class ProgressableDownloader

lucee.Component
    extended by commandbox.system.util.ProgressableDownloader

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com Allows a file to be downloaded progressively with a callback UDF for status

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano, Denny Valliant
  •  
    Property Summary
    type property default serializable required
    any ConfigService


    • access = public
    • returntype = any
    • inject = ConfigService
    true false
    any shell


    • access = public
    • returntype = any
    • inject = shell
    true false
    Method Summary
    any download(string downloadURL, string destinationFile, [any statusUDF], [any redirectUDF=''])
         Call me to download a file with a status callback.
    private binary getByteArray(numeric size)
    private any resolveConnection(string downloadURL, [any redirectUDF])
     
    Methods inherited from class lucee.Component
    None

    Property Detail

    ConfigService

    property any ConfigService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ConfigService
    serializable - true

    shell

    property any shell

    Attributes:
    access - public
    required - false
    returntype - any
    inject - shell
    serializable - true

    Method Detail

    download

    public any download(string downloadURL, string destinationFile, [any statusUDF], [any redirectUDF=''])

    Call me to download a file with a status callback

    Parameters:
    downloadURL - The remote URL to download
    destinationFile - The local file path to store the downloaded file
    statusUDF - A closure that will be called once for each full percent of completion. Accepts a struct containing percentage, averageKBPS, totalKB, and downloadedKB
    redirectUDF - A closure that will be called once for every 30X redirect followed

    getByteArray

    private binary getByteArray(numeric size)

    Parameters:
    size

    resolveConnection

    private any resolveConnection(string downloadURL, [any redirectUDF])

    Parameters:
    downloadURL
    redirectUDF