Package java.util.jar

Examples of java.util.jar.Manifest


        }
        return manifest;
    }

    private Manifest getManifestSafe() {
        Manifest manifest = null;
        try {
            manifest = getManifest();
        } catch (IOException e) {
            // ignore
        }
View Full Code Here


                verifier.setPedantic(isPedantic());
                verifier.verify();
                getInfo(verifier);
            }
            if ((options & MANIFEST) != 0) {
                Manifest manifest = jar.getManifest();
                if (manifest == null)
                    warning("JAR has no manifest " + file);
                else {
                    out.println("[MANIFEST " + jar.getName() + "]");
                    printManifest(manifest);
                }
                out.println();
            }
            if ((options & IMPEXP) != 0) {
                out.println("[IMPEXP]");
                Manifest m = jar.getManifest();

                if (m != null) {
                    Domain domain = Domain.domain(m);
                    Parameters imports = domain.getImportPackage();
                    Parameters exports = domain.getExportPackage();
View Full Code Here

     *
     * @param jar
     */
    private void printComponents(Jar jar) throws Exception {
        out.println("[COMPONENTS]");
        Manifest manifest = jar.getManifest();
        if (manifest == null) {
            out.println("No manifest");
            return;
        }

        String componentHeader = manifest.getMainAttributes().getValue(Constants.SERVICE_COMPONENT);
        Parameters clauses = new Parameters(componentHeader);
        boolean printed = false;
        for (String path : clauses.keySet()) {
            printed = true;
            out.println(path);
View Full Code Here

     *
     * @param jar
     */
    private void printMetatype(Jar jar) throws Exception {
        out.println("[METATYPE]");
        Manifest manifest = jar.getManifest();
        if (manifest == null) {
            out.println("No manifest");
            return;
        }

View Full Code Here

        }

        JarInputStream jarStream = null;
        try {
            jarStream = new JarInputStream(new FileInputStream(bundlePath.toFile()), false);
            Manifest manifest = jarStream.getManifest();
            if (manifest == null) {
                return null;
            }

            Domain domain = Domain.domain(manifest);
View Full Code Here

    static void mergeCapabilities(Map<String,List<ExportPackage>> exports, MultiMap<String,String> usedBy, Map<String,Set<Version>> bundleVersions, Builder builder) throws Exception {
        Jar jar = builder.getJar();
        if (jar == null)
            return;
        Manifest manifest = jar.getManifest();
        if (manifest == null)
            return;

        Attributes attribs = manifest.getMainAttributes();
        String exportPkgStr = attribs.getValue(Constants.EXPORT_PACKAGE);
        Parameters exportsMap = new Parameters(exportPkgStr);

        // Merge the exports
        Map<PackageRef,List<PackageRef>> uses = builder.getUses();
View Full Code Here

    static void mergeRequirements(Map<String,List<ImportPackage>> imports, Map<String,List<ExportPackage>> exports, MultiMap<String,String> usedBy, Map<String,List<RequiredBundle>> requiredBundles, Map<String,Set<Version>> bundleVersions,
            Builder builder) throws Exception {
        Jar jar = builder.getJar();
        if (jar == null)
            return;
        Manifest manifest = jar.getManifest();
        if (manifest == null)
            return;
        Attributes attribs = manifest.getMainAttributes();

        // Process imports
        String importPkgStr = attribs.getValue(Constants.IMPORT_PACKAGE);
        Parameters importsMap = new Parameters(importPkgStr);
        for (Entry<String,Attrs> entry : importsMap.entrySet()) {
View Full Code Here

            addAccessRules(projectAccessRules, c.getProject(), tmp);
        } else if (isProjectContainer(c)) {
            // No access rules please.
            addAccessRules(projectAccessRules, c.getProject(), null);
        } else if (c.getType() == TYPE.PROJECT) {
            Manifest mf = null;
            try {
                mf = JarUtils.loadJarManifest(new FileInputStream(c.getFile()));
            } catch (IOException e) {
                logger.logError("Unable to generate access rules from bundle " + c.getFile(), e);
                return;
            }
            Parameters exportPkgs = new Parameters(mf.getMainAttributes().getValue(new Name(Constants.EXPORT_PACKAGE)));
            List<IAccessRule> tmp = new LinkedList<IAccessRule>();
            for (String exportPkg : exportPkgs.keySet()) {
                String pathStr = exportPkg.replace('.', '/') + "/*";
                tmp.add(JavaCore.newAccessRule(new Path(pathStr), IAccessRule.K_ACCESSIBLE));
            }
View Full Code Here

                verifier.setPedantic(isPedantic());
                verifier.verify();
                getInfo(verifier);
            }
            if ((options & MANIFEST) != 0) {
                Manifest manifest = jar.getManifest();
                if (manifest == null)
                    warning("JAR has no manifest " + file);
                else {
                    out.println("[MANIFEST " + jar.getName() + "]");
                    printManifest(manifest);
                }
                out.println();
            }
            if ((options & IMPEXP) != 0) {
                out.println("[IMPEXP]");
                Manifest m = jar.getManifest();

                if (m != null) {
                    Domain domain = Domain.domain(m);
                    Parameters imports = domain.getImportPackage();
                    Parameters exports = domain.getExportPackage();
View Full Code Here

     *
     * @param jar
     */
    private void printComponents(Jar jar) throws Exception {
        out.println("[COMPONENTS]");
        Manifest manifest = jar.getManifest();
        if (manifest == null) {
            out.println("No manifest");
            return;
        }

        String componentHeader = manifest.getMainAttributes().getValue(Constants.SERVICE_COMPONENT);
        Parameters clauses = new Parameters(componentHeader);
        boolean printed = false;
        for (String path : clauses.keySet()) {
            printed = true;
            out.println(path);
View Full Code Here

TOP

Related Classes of java.util.jar.Manifest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.