List JAR files in WebStart

D

Daniel

Hi

I'm using WebStart to deploy an application consisting of several JAR
files. Each JAR file contains a VersionInfo.xml file in the META-INF
directory to identify the version of the JAR.

One of the JAR files (db.jar) contains a HSQLDB database which I need
to extract into the file system before usage. Maybe you know how to
solve the following two problems, both having to do the fact that I am
not able to address the JAR file db.jar as a whole:

1. As a workaround, I explicitely extract each db file within db.jar
with the getResourceAsStrem-Method of the class loader.

2. I would like to extract the VersionInfo.xml as well, however,
several equally named files exist and therfore I just get the first
one found, which is not the right one.

Any idea on how to address a JAR file within a WebStart application as
a whole to pass it to an unzipper would be highly appreciated.

Thanks
Daniel Frey
 
D

Daniel

Another problem arose in the same context: Some of the JAR files are
plugins, which are registered dynamically. Each of these plugin JARs
represents a mode for the application, and the ModeManager identifies
them by inspecting the VersionInfo.xml in the JARs META-INF directory.
Also here, I need access to the JAR files included in the application
in order to register the different modes.

All these issues (this one the those described in the original
posting) would be solved by having an enumeration of the JAR files
delivered for this WebStart application.

Any hint would be highly apprecieated

Thanks
Daniel Frey
 
A

Andrew Thompson

....
| I'm using WebStart to deploy an application consisting of
several JAR
| files. Each JAR file contains a VersionInfo.xml file in the
META-INF
| directory to identify the version of the JAR.
....
| 2. I would like to extract the VersionInfo.xml as well,
however,
| several equally named files exist and therfore I just get the
first
| one found, which is not the right one.

have you tried..
Class.getResource( "thisdirectory/VersionInfo.xml" );
Class.getResource( "thatdirectory/VersionInfo.xml" );

OTOH, if you can get a handle to the entire jar, you could..

File myJarFile..
ZipFile zf = new ZipFile( myJarFile );
Enumeration entries = zf.entries();

...done

HTH
 
D

Daniel

Solution found:

Enumeration e = getClassLoader().getResources("META-INF/VersionInfo.xml");

Thanks anyway
Daniel Frey
 
A

Andrew Thompson

| Solution found:
|
| Enumeration e =
getClassLoader().getResources("META-INF/VersionInfo.xml");
|
| Thanks anyway

You're (friggin') welcome..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top