Hi, folks!
This web page shows how to programmatically read files from within a
jar file:
http://java.sun.com/developer/JDCTechTips/2003/tt0122.html
I have a jar file, however, that contains another jar file. Does anyone
know how to easily read the class files from the "inner" jar file?
Programmatically, I find myself with a JarEntry that represents my
inner jar file, and I'd hoped for a constuctor such as:
JarFile(JarEntry entry)
This would allow me to recursively analyse the inner jar file. But
JarFile doesn't take such a constructor.
Is there an easier way than just copying the JarEntry out to a
temporary file, and opening that as a new JarFile?
Thanks,
.ed
www.EdmundKirwan.com - Home of The Fractal Class Composition
Lee Fesperman - 25 May 2005 21:40 GMT
> Hi, folks!
>
[quoted text clipped - 15 lines]
> Is there an easier way than just copying the JarEntry out to a
> temporary file, and opening that as a new JarFile?
JarFile needs to open the jar with java.io.RandomAccessFile, so you'll have to build the
temporary file. Alternatively, you can use JarInputStream and process it that way.

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)