<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
====

Jar::Manifest - Read and Write Java Jar Manifests

SYNOPSIS
========

    use Jar::Manifest qw(Dump Load);

    # Read a Manifest
    my $manifest_str = &lt;&lt;"MANIFEST";
    Manifest-Version: 1.0
    Created-By: 1.5.0_11-b03 (Sun Microsystems Inc.)
    Built-By: JAPH

    Name: org/myapp/foo/
    Implementation-Title: Test Java JAR
    Implementation-Version: 1.9
    Implementation-Vendor: JAPH

    MANIFEST

    my $manifest = Load($manifest_str);
    printf( "Jar built by -&gt; %s\n", $manifest-&gt;{main}-&gt;{'Built-By'} );
    printf(
        "Name: %s\nVersion: %s\n",
        $_-&gt;{Name}, $_-&gt;{'Implementation-Version'}
        )
        for @{ $manifest-&gt;{entries} };

    # Write a manifest
    my $manifest = {

        # Main attributes
        main =&gt; {
            'Manifest-Version' =&gt; '1.0',
            'Created-By'       =&gt; '1.5.0_11-b03 (Sun Microsystems Inc.)',
            'Built-By'         =&gt; 'JAPH',
        },

        # Entries
        entries =&gt; [
            {
                'Name'                   =&gt; 'org/myapp/foo/',
                'Implementation-Title'   =&gt; 'Test Java JAR',
                'Implementation-Version' =&gt; '1.9',
                'Implementation-Vendor'  =&gt; 'JAPH',
            }
        ],
    };
    my $manifest_string = Dump($manifest);

DESCRIPTION
===========

Jar::Manifest provides a perl interface to read and write Manifest files
found within Java archives - typically META-INF/MANIFEST.MF within a
.jar file.

The Jar Manifest specification can be found here
http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR_Manifest

METHODS
=======

-   Load($string)

    use Jar::Manifest qw(Load); use Data::Dumper;

    my manifest = Load(string); print Dumper $manifest;

Read the manifest contents in $string. Returns a hash-reference
containing two keys. The main key is another hash-reference to the main
attributes and corresponding values. The entries key is an array-ref of
hashes containing per-entry attributes and the corresponding values

-   Dump($manifest)

    print Dump($manifest);

Turns the $manifest data structure into a string that can be printed to
a MANIFEST.MF file. The $manifest structure is expected to be in the
same format as the Load() output.

DEPENDENCIES
============

Encode

Text::Wrap

BUGS AND LIMITATIONS
====================

Please report any bugs or feature requests to
bug-jar-manifest@rt.cpan.org, or through the web interface at
http://rt.cpan.org/Public/Dist/Display.html?Name=Jar-Manifest

AUTHOR
======

Mithun Ayachit mithun@cpan.org

LICENSE AND COPYRIGHT
=====================

Copyright (c) 2012, Mithun Ayachit. All rights reserved.

This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See perlartistic.
</pre></body></html>