import java.io.*; import java.util.jar.*; import java.util.zip.*; /** * @version 1.0 2002-04-29 * @author Takashi KOBAYASHI */ public class ex2 { static String filename = "jis.jar"; static String readentryext = ".jar"; public static void main( String[] args ) { try { JarInputStream jis = new JarInputStream( new BufferedInputStream( new FileInputStream( filename ) ) ); JarEntry je; while( ( je = jis.getNextJarEntry() ) != null ) { System.out.println( je.getName() ); if( je.getName().endsWith( readentryext ) ) { JarInputStream jis2 = new JarInputStream( jis ); JarEntry je2; while( jis.available() > 0 && ( je2 = jis2.getNextJarEntry() ) != null ) { System.out.println( je.getName() + "# " + je2.getName() ); } } } } catch( IOException ioe ) { ioe.printStackTrace(); } } }