Cupt::Download::Method(3) base class for all Cupt download methods

ABSTRACT

It should be never instantiated directly. If you want to write your own download method for Cupt, you are need to implement 'perform' method specified under.

METHODS

new

creates new Cupt::Download::Method object

perform

downloads specified file

Parameters:

config - reference to Cupt::Config

uri - string that determines URL to download

filename - target file name

sub_callback - callback subroutine to report status change of download

Allowed param sets:
  • ``connecting'', ``$ip[:$port]''
  • ``expected-size'', expected_size
  • ``downloading'' - total_downloaded_bytes fetched_bytes;

where:

expected_size - size of file to download

total_downloaded_bytes - number of bytes done for download; in case of resumed download this number should include already downloaded size

fetched_bytes - number of bytes that were really fetched since the last callback call

Returns: '' if all went smoothly, error string in case of error

FREE SUBROUTINES

get_acquire_suboption_for_uri

returns the value of some acquire suboption of 'acquire' group should be used for supplied URI. This subroutine honors global and per-host settings.

Parameters:

config - reference to Cupt::Config

uri - URI string

suboption_name - suboption name

Example:

"get_acquire_param_for_uri($config, $uri, 'proxy')"