Java Jar Manifest getManifestPath(String moduleDir)

Here you can find the source of getManifestPath(String moduleDir)

Description

get Manifest Path

License

Apache License

Declaration

protected static String getManifestPath(String moduleDir) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static final String META_INF_DIR_NAME = "META-INF";
    public static final String MANIFEST_FILE_NAME = "MANIFEST.MF";

    protected static String getManifestPath(String moduleDir) {
        String manifestFileLocation = getManifestFileLocation(moduleDir);
        File manifestFile = new File(manifestFileLocation);
        if (!manifestFile.exists()) {
            throw new RuntimeException(
                    "The specified Manifest file doesn't exist: "
                            + manifestFileLocation);
        }// w  w w  .  j a  v a 2s. c om
        return manifestFileLocation;
    }

    protected static String getManifestFileLocation(String moduleDir) {
        String manifestLocation = new StringBuilder(moduleDir)
                .append(File.separator).append(META_INF_DIR_NAME)
                .append(File.separator).append(MANIFEST_FILE_NAME)
                .toString();
        return manifestLocation;
    }
}

Related

  1. getManifestEntryValue(IResource manifest, String entryKey)
  2. getManifestFileLocation(String moduleDir)
  3. getManifestHeaders(File aJarFile)
  4. getManifestHeaders(Manifest manifest)
  5. getManifestHeaderValues(final Manifest manifest, final String headerName)
  6. getManifestProperty(ClassLoader clContainingManifest, String manifestKey)
  7. getManifestProperty(File file, String name)
  8. getManifestProperty(Manifest manifest, String propertyName)
  9. getManifestValue(File jarFile, String key)