Java 网络教程: JarURLConnection
Java 中 JarURLConnection 类用来链接 Java 的 Jar 包文件。一旦连接成功,你就可以获取到 Jar 包里面文件的内容。
下面是一个简单的实例:
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...
...
时间: 2024-10-21 20:22:10