Code example for Manifest

Methods: getMainAttributes

0
 
        // And now reread the manifest: 
        // 
        JarFile jarIn = new JarFile(jarFile);
        manifest = jarIn.getManifest();
        attrs = manifest.getMainAttributes();
        assertEquals("MANIFEST_VERSION must match!", "3.1415962",
                attrs.get(Attributes.Name.MANIFEST_VERSION));
        assertEquals("MAIN_CLASS must match!", "dalvikExecTest.HelloWorld",
                attrs.get(Attributes.Name.MAIN_CLASS));
        assertEquals("CLASS_PATH must match!", jarFile.getName(),
                attrs.get(Attributes.Name.CLASS_PATH));
    } 
 
 
    /* 
     * The following two classes are added, here, only for completeness. 
     * They form the contents of the dalvikExecTest package contained 
     * in the 'cts_dalvikExecTest_classes.dex' resource file. 
     */ 
    /**