Rechercher une page de manuel
Cupt::Download::Manager.3pm
Langue: en
Version: 2009-06-21 (debian - 07/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
Cupt::Download::Manager - file download manager for CuptMETHODS
new
creates new Cupt::Download::Manager and returns reference to itParameters:
config - reference to Cupt::Config
progress - reference to object of subclass of Cupt::Download::Progress
download
method, adds group of download queries to queue. Blocks execution of program until all downloads are done.This method is re-entrant.
Parameters:
Sequence of hash entries with the following fields:
uris - array of mirror URIs to download, mandatory
filename - target filename, mandatory
post-action - reference to subroutine that will be called in case of successful download, optional
size - fixed size for target, will be used in sanity checks, optional
Returns:
result - '0' on success, otherwise the string that contains the fail reason,
Example:
my $download_manager = new Cupt::Download::Manager; $download_manager->download( { 'uris' => [ 'http://www.en.debian.org' ], 'filename' => '/tmp/en.html' }, { 'uris' => [ 'http://www.ru.debian.org' ], 'filename' => '/tmp/ru.html', 'post-action' => \&checker }, { 'uris' => [ 'http://www.ua.debian.org' ], 'filename' => '/tmp/ua.html', 'size' => 10254 } { 'uris' => [ 'http://ftp.de.debian.org/debian/pool/main/n/nlkt/nlkt_0.3.2.1-2_amd64.deb', 'http://ftp.es.debian.org/debian/pool/main/n/nlkt/nlkt_0.3.2.1-2_amd64.deb' ], 'filename' => '/var/cache/apt/archives/nlkt_0.3.2.1-2_amd64.deb' } );
set_short_alias_for_uri
method, forwards params to underlying download progressset_long_alias_for_uri
method, forwards params to underlying download progressContenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre