Archive::Any::Plugin::Zip - Archive::Any wrapper around Archive::Zip


Archive-Any documentation Contained in the Archive-Any distribution.

Index


Code Index:

NAME

Top

Archive::Any::Plugin::Zip - Archive::Any wrapper around Archive::Zip

SYNOPSIS

Top

DO NOT USE THIS MODULE DIRECTLY

Use Archive::Any instead.

DESCRIPTION

Top

Wrapper around Archive::Zip for Archive::Any.

SEE ALSO

Top

Archive::Any, Archive::Zip


Archive-Any documentation Contained in the Archive-Any distribution.
package Archive::Any::Plugin::Zip;

use strict;
use vars qw($VERSION);
$VERSION = 0.03;

use base qw(Archive::Any::Plugin);

use Archive::Zip qw(:ERROR_CODES);

sub can_handle {
    return(
           'application/x-zip',
           'application/x-jar',
           'application/zip',
          );
}

sub files {
    my( $self, $file ) = @_;

    my $z = Archive::Zip->new( $file );
    return $z->memberNames;
}


sub extract {
    my($self, $file) = @_;

    my $z = Archive::Zip->new( $file );
    $z->extractTree;

    return 1;
}

sub type {
    my $self = shift;
    return 'zip';
}


1;