Java Networking: JarURLConnection

Jakob Jenkov
Last update: 2014-06-23

Java's JarURLConnection class is used to connect to a Java Jar file. Once connected you can obtain information about the contents of the Jar file. Here is a simple example:

String urlString = "http://butterfly.jenkov.com/"
                 + "container/download/"
                 + "jenkov-butterfly-container-2.9.9-beta.jar";

URL jarUrl = new URL(urlString);
JarURLConnection connection = new JarURLConnection(jarUrl);

Manifest manifest = connection.getManifest();


JarFile jarFile = connection.getJarFile();

//do something with Jar file...

...    

Jakob Jenkov

Featured Videos















Core Software Performance Optimization Principles




Advertisements

High-Performance
Java Persistence
Close TOC

All Trails

Trail TOC

Page TOC

Previous

Next