Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

Programmatically reading jars from with jars

Thread view: 
iamfractal@hotmail.com - 25 May 2005 21:08 GMT
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)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.