NAME
CPAN::Access::AdHoc::Archive::Tar - Provide consistent interface to Archive::Tar
SYNOPSIS
use CPAN::Access::AdHoc::Archive::Tar;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $resp = $ua->get( ... );
my $tar = CPAN::Access::AdHoc::Archive::Tar->new(
content => \( $resp->content() ),
encoding => $resp->header( 'Content-Encoding' ),
);
DESCRIPTION
This class is a subclass of Archive::Tar, provided for the convenience of CPAN::Access::AdHoc. It is private to the CPAN-Access-AdHoc
package.
METHODS
This class supports the following public methods over and above those supported by its superclass:
new
This override of the superclass' new()
method instantiates the object, and possibly loads it. There are two supported arguments:
- content
-
This is the content to be loaded into the object. A scalar reference is assumed to be the literal content. A non-reference is assumed to be the file name. Any other value is unsupported.
However specified, the content must represent a valid tar file.
- encoding
-
This is the MIME encoding of the content. It is ignored if the content is not present. Encodings
'gzip'
and'x-bzip2'
are supported. If not present, the content is assumed not to be encoded.
get_item_content
This method returns the content of the named item in the archive. It is simply a wrapper for Archive::Tar->get_content()
.
list_contents
This method lists the contents of the archive. It is simply a wrapper for Archive::Tar->list_files()
.
SEE ALSO
SUPPORT
Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.