如何读取jar包外的jar文件

我用的是webstart实现动态加载功能 
这是我的jnlp文件 
<?xml version="1.0" encoding="gb2312"?> 

<jnlp codebase="http://192.168.0.125:8080/dynamic"> 
<information> 

  <title>动态加载 </title> 
  <vendor>RookieSoft Corporation </vendor> 
  <description>MyIE just demo how to program with jnlp. </description> 
  <homepage href="http://192.168.0.125:8080/dynamic" /> 
  <offline-allowed/> 
</information> 
  <security> 
        <all-permissions/> 
  </security> 

<resources> 

  <j2se version="1.4+"/> 
  <jar href="lib/dynamic1.jar"/> 
  <jar href="lib/dynamic2.jar"/> 
</resources> 

<application-desc main-class="lits.test.main.LoadAllJar"> 
  <argument>dynamic2.jar </argument> 
</application-desc> 

</jnlp> 

这是LoadAllJar 类 
public class LoadAllJar { 

public LoadAllJar() { 
} 

public static void main(String [] args) throws IOException { 
if (args.length > 0){ 
for (String jarName : args) { 
// JarFile jar = new JarFile(jarName); 
System.out.println(jarName); 
System.out.println(ClassLoader.getSystemResource(jarName)); 
ClassLoader loader = ClassLoader.getSystemClassLoader(); 
System.out.println(loader.getResource(jarName)); 
} 
} 
} 
} 

我在LoadAllJar 类中如何得到dynamic2.jar的内容,不是class类的,我想得到dynamic2.jar的manifest.mf信息 
dynamic1.jar和dynamic2.jar是不同的jar包,两者没有关联 
忘高手指教!

 

你可能感兴趣的:(xml,Security,J2SE)