NAME
CPAN::Access::AdHoc::Archive::Zip - Provide a consistent interface to Archive::Zip
SYNOPSIS
use CPAN::Access::AdHoc::Archive::Zip;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
my $resp = $ua->get( ... );
my $tar = CPAN::Access::AdHoc::Archive::Zip->new(
content => \( $resp->content() ),
encoding => $resp->header( 'Content-Encoding' ),
);
DESCRIPTION
This class is a subclass of Archive::Zip::Archive, 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, or with functionality over and above that of the 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 value must represent a valid zip file.
- encoding
-
This is the MIME encoding of the content. It is ignored if the content is not present. Since the zip format implies its own encoding, this argument may only be specified as
undef
.
get_item_content
This method returns the content of the named item in the archive. It is simply a wrapper for Archive::Zip->memberNamed()->contents()
.
get_item_mtime
Unfortunately, Zip file entry time stamps are in local time, and there is no zone information included. This means that unless this is called in the same time zone in which the Zip entry was created you get the wrong time. In other words, the results of this method are useless.
list_contents
This method lists the contents of the archive. It is simply a wrapper for Archive::Zip->memberNames()
.
SEE ALSO
The parent class, Archive::Zip.
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.