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...
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/117248.html