package atg.tools.ant.util;

import java.io.File;

/**
 * Utility class for dealing with JAR manifest files.
 *
 * @author msicker
 * @version 2.0
 */
public final class ManifestUtils {

    public static final String META_INF = "META-INF";
    public static final String MANIFEST_MF = "MANIFEST.MF";

    private ManifestUtils() {
    }

    /**
     * Gets a File reference to the {@code META-INF/MANIFEST.MF} file within the given directory.
     *
     * @param baseDirectory directory to locate manifest file within.
     *
     * @return manifest file object (which may or may not exist).
     *
     * @throws java.lang.IllegalArgumentException if {@code baseDirectory} is not an existing directory, or if
     *                                            {@code baseDirectory} contains a file called {@code META-INF} which is
     *                                            not a directory.
     */
    public static File getManifestIn(final File baseDirectory) {
        if (!baseDirectory.isDirectory()) {
            throw new IllegalArgumentException("Provided file `" + baseDirectory + "' is not a valid directory.");
        }
        final File metaInf = new File(baseDirectory, META_INF);
        if (metaInf.exists() && !metaInf.isDirectory()) {
            throw new IllegalArgumentException("The location `" + metaInf + "' already exists, but is not a directory.");
        }
        return new File(metaInf, MANIFEST_MF);
    }

}

@@ -42,16 +42,107 @@
 io.File;
+%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.util.jar.Manifest;
 %0A%0A/**%0A *
@@ -1535,10 +1535,595 @@
 %0A    %7D%0A%0A
+    /**%0A     * Loads a given manifest file into a Manifest.%0A     *%0A     * @param file file containing manifest metadata.%0A     *%0A     * @return said file parsed into a Manifest object.%0A     *%0A     * @throws IOException if the given file does not exist or is an invalid manifest file.%0A     */%0A    public static Manifest load(final File file)%0A            throws IOException %7B%0A        FileInputStream fis = null;%0A        try %7B%0A            fis = new FileInputStream(file);%0A            return new Manifest(fis);%0A        %7D finally %7B%0A            FileUtils.closeSilently(fis);%0A        %7D%0A    %7D%0A%0A
 %7D%0A

Add manifest file loader method.