Best code examples for Java 8 JarInputStream class (java.util.jar.JarInputStream)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 JarInputStream class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 JarInputStream examples from Open Source projects
This code example shows how to use the following methods: getNextJarEntry, available, close
		System.out.println("jar url is " + url);
		URLConnection con = url.openConnection();
		System.out.println(con);
		System.out.println(con.getContentType());
		InputStream stream = con.getInputStream();
		JarInputStream jis = new JarInputStream(stream);
		System.out.println(jis);
		System.out.println(jis.available());
		System.out.println(jis.getNextJarEntry());
		System.out.println(jis.getNextJarEntry());
		System.out.println(jis.getNextJarEntry());
		System.out.println(jis.available());
		System.out.println(jis.getNextJarEntry());
		System.out.println(jis.available());
		jis.close();
	} 
 
	// @Override 
	// protected OsgiPlatform createPlatform() { 
	// OsgiPlatform platform = super.createPlatform(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getManifest
        this.file = file;
        FileInputStream fis = null;
        JarInputStream jar = null;
        try { 
            fis = new FileInputStream(file);
            jar = new JarInputStream(fis);
            Manifest manifest = jar.getManifest();
            if (manifest == null)
                throw new PluginException(name, tr("The plugin file ''{0}'' does not include a Manifest.", file.toString()));
            scanManifest(manifest, false);
            libraries.add(0, Utils.fileToURL(file));
        } catch (IOException e) {
            throw new PluginException(name, e);
        } finally { 
            Utils.close(jar);
            Utils.close(fis);
        } 
    } 
 
    /** 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getManifest, close
 
        Manifest manifest = null;
        JarInputStream jin = null;
 
        try { 
            jin = new JarInputStream(inStream);
            manifest = jin.getManifest();
            jin.close();
            jin = null;
        } finally { 
            if (jin != null) {
                try { 
                    jin.close();
                } catch (Throwable t) {
                    // Ignore 
                } 
            } 
        } 
 
        return manifest;
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getManifest
    public Manifest getManifest() throws IOException {
        if (jarFile != null) {
            return jarFile.getManifest();
        } else { 
            try { 
                JarInputStream is = new JarInputStream(new ByteArrayInputStream(this.content));
                return is.getManifest();
            } catch (IOException e) {
                e.printStackTrace();
            } 
        } 
        return null; 
    } 
 
    @Override 
    public void close() { 
        if (jarFile != null) {
            try { 
                jarFile.close();
            } catch (Exception ignored) {
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getManifest, close
public class JarUtils { 
 
    public static Manifest loadJarManifest(InputStream stream) throws IOException {
        JarInputStream jarInputStream = null;
        try { 
            jarInputStream = new JarInputStream(stream);
            return jarInputStream.getManifest();
        } finally { 
            if (jarInputStream != null) {
                try { 
                    jarInputStream.close();
                } catch (IOException e) {
                    /* swallow */ 
                } 
            } 
        } 
    } 
} 
Full Snippet Info
6
CodeRank
See Code Examples for Java 8 JarInputStream Methods: