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-26 16:20:08