Reputation: 7380
Is there a way to get the JAR files referenced under <resources>
within the .jnlp file of Java WebStart? I thought the JNLP API could help, but didn´t find any method for that. Any ideas?
Example:
[...]
<resources>
<j2se version="1.6.0+" />
<jar href="../lib/wsfacade.jar"/>
<jar href="../lib/resources.jar"/>
</resources>
[...]
I want to get the path to wsfacade.jar for example, is that possible?
Upvotes: 0
Views: 1114
Reputation: 10998
The DownloadService2 interface from the JNLP API can give you the resources of the application:
DownloadService2 service = (DownloadService2) ServiceManager.lookup("javax.jnlp.DownloadService2");
ResourceSpec alljars = new ResourceSpec(".*", ".*", DownloadService2.JAR)
ResourceSpec[] results = service.getCachedResources(alljars);
for (ResourceSpec spec : results) {
System.out.println(spec.getUrl());
}
For the reference:
Upvotes: 1