slackget10::Network::Connection::HTTP - This class encapsulate LWP::Simple
Version 1.0.0
This class encapsulate LWP::Simple, and provide some methods for the treatment of HTTP requests.
You can't use this class without the slackget10::Network::Connection one.
This class need the following extra CPAN modules :
- LWP::Simple - Time::HiRes use slackget10::Network::Connection::HTTP; my $foo = slackget10::Network::Connection::HTTP->new(); ...
This module require the following modules from CPAN : LWP::Simple, Time::HiRes.
This method test the rapidity of the mirror, by timing a head request on the FILELIST.TXT file.
my $time = $self->test_server() ;
Download and return a given file.
my $file = $connection->get_file('PACKAGES.TXT') ;
Download and store a given file.
$connection->fetch_file() ; # download the file $connection->file and store it at $config->{common}->{'update-directory'}/$connection->file, this way is not recommended or $connection->fetch_file($remote_file) ; # download the file $remote_file and store it at $config->{common}->{'update-directory'}/$connection->file, this way is not recommended or $connection->fetch_file('PACKAGES.TXT',"$config->{common}->{'update-directory'}/".$current_specialfilecontainer_object->id."/PACKAGES.TXT") ; # This is the recommended way. # This is equivalent to : $connection->fetch_file($remote_file,$local_file) ;
This method return 1 if all goaes well, else return undef.
This method fetch all files declare in the "files" parameter of the constructor.
$connection->fetch_all or die "Unable to fetch all files\n";
This method save all files in the $config->{common}->{'update-directory'} directory (so you have to manage yourself the files deletion/replacement problems)
DUPUIS Arnaud, <a.dupuis@infinityperl.org>
<a.dupuis@infinityperl.org>
Please report any bugs or feature requests to bug-slackget10-networking@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=slackget10. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-slackget10-networking@rt.cpan.org
Copyright 2005 DUPUIS Arnaud, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install slackget10, copy and paste the appropriate command in to your terminal.
cpanm
cpanm slackget10
CPAN shell
perl -MCPAN -e shell install slackget10
For more information on module installation, please visit the detailed CPAN module installation guide.