Package java.util.jar

Examples of java.util.jar.Manifest$FastInputStream


    private JarEntry getBaseEntry(String name) {
        return baseJar.getJarEntry(basePath + name);
    }

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


            if (manifestFile != null && manifestFile.isFile()) {
                FileInputStream in = null;
                try {
                    in = new FileInputStream(manifestFile);
                    manifest = new Manifest(in);
                } finally {
                    if (in != null) {
                        try {
                            in.close();
                        } catch (IOException e) {
View Full Code Here

    }

    public Enumeration entries() {
        Collection files = DeploymentUtil.listRecursiveFiles(baseDir);

        Manifest manifest = getManifestSafe();
        LinkedList entries = new LinkedList();
        URI baseURI = baseDir.getAbsoluteFile().toURI();
        for (Iterator iterator = files.iterator(); iterator.hasNext();) {
            File entryFile = ((File) iterator.next()).getAbsoluteFile();
            URI entryURI = entryFile.toURI();
View Full Code Here

        }
        return file;
    }

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

        File target = prepareTestJar( "javax.persistence_2.0.5.v201212031355.jar" );

        assertTrue( JarSignerUtil.isArchiveSigned( target ) );

        // check that manifest contains some digest attributes
        Manifest originalManifest = readManifest( target );
        assertTrue( containsDigest( originalManifest ) );

        Manifest originalCleanManifest = JarSignerUtil.buildUnsignedManifest( originalManifest );
        assertFalse( containsDigest( originalCleanManifest ) );

        assertTrue( originalCleanManifest.equals( JarSignerUtil.buildUnsignedManifest( originalCleanManifest ) ) );

        JarSignerUtil.unsignArchive( target );

        assertFalse( JarSignerUtil.isArchiveSigned( target ) );

        // check that manifest has no digest entry
        // see https://jira.codehaus.org/browse/MSHARED-314
        Manifest manifest = readManifest( target );

        Manifest cleanManifest = JarSignerUtil.buildUnsignedManifest( manifest );
        assertFalse( containsDigest( cleanManifest ) );

        assertTrue( manifest.equals( cleanManifest ) );
        assertTrue( manifest.equals( originalCleanManifest ) );
View Full Code Here

    private Manifest readManifest( File file )
        throws IOException
    {
        JarFile jarFile = new JarFile( file );

        Manifest manifest = jarFile.getManifest();

        jarFile.close();

        return manifest;
    }
View Full Code Here

      
        File clientJarFile = new File((String)context.get(ToolConstants.CFG_OUTPUTDIR),
                                      (String)context.get(ToolConstants.CFG_CLIENT_JAR));
        JarOutputStream jarout = null;
        try {
            jarout = new JarOutputStream(new FileOutputStream(clientJarFile), new Manifest());
            createClientJar(tmpDir, jarout);
            jarout.close();
        } catch (Exception e) {
            LOG.log(Level.SEVERE, "FAILED_TO_CREAT_CLIENTJAR", e);
            Message msg = new Message("FAILED_TO_CREAT_CLIENTJAR", LOG);
View Full Code Here

    {
        JarFile jar;
        try
        {
            jar = new JarFile( bundle );
            Manifest manifest = jar.getManifest();

            if ( manifest == null )
            {
                return null;
            }

            for ( Map.Entry<Object, Object> attr : manifest.getMainAttributes().entrySet() )
            {
                if ( attr.getKey().toString().equals( "Export-Package" ) )
                {
                    return attr.getValue().toString();
                }
View Full Code Here

            return dialect;
        }
    }
   
    private static StAXDialect detectDialectFromJarManifest(URL rootUrl) {
        Manifest manifest;
        try {
            URL metaInfUrl = new URL(rootUrl, "META-INF/MANIFEST.MF");
            InputStream is = metaInfUrl.openStream();
            try {
                manifest = new Manifest(is);
            } finally {
                is.close();
            }
        } catch (IOException ex) {
            log.warn("Unable to load manifest for StAX implementation at " + rootUrl);
            return UnknownStAXDialect.INSTANCE;
        }
        Attributes attrs = manifest.getMainAttributes();
        String title = attrs.getValue(IMPLEMENTATION_TITLE);
        String symbolicName = attrs.getValue(BUNDLE_SYMBOLIC_NAME);
        if (symbolicName != null) {
            int i = symbolicName.indexOf(';');
            if (i != -1) {
View Full Code Here

            if (manifestFile.isFile() && manifestFile.canRead()) {
                FileInputStream in = null;
                try {
                    in = new FileInputStream(manifestFile);
                    manifest = new Manifest(in);
                } finally {
                    IoUtil.close(in);
                }
            }
            manifestLoaded = true;
View Full Code Here

TOP

Related Classes of java.util.jar.Manifest$FastInputStream

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.