How to read directory from jar file in web start

I am trying to implement Java WebStart, but the problem I am facing is that I need to get the directory from the jar file without any luck ...

I need to read the following directory:

jar:http://localhost:8080/nadeploy/lib/NuevaAldeaFonts.jar!/net/perroazul/nafonts/res

When I install it as:

new File(new URL("jar:http://...nafonts/res").toURI());

it throws an IllegalArgumentException.

And if I try to open the jar file to read the directory as a jar entry with

JarFile fj = new JarFile("http://localhost:8080/nadeploy/lib/NuevaAldeaFonts.jar");

It throws the following exception:

java.io.FileNotFoundException: http: \ localhost: 8080 \ nadeploy \ lib \ NuevaAldeaFonts.jar

Do I have any additional options for reading the catalog from the jar obtained in Web Start?

Thanks in advance

+3
source share
1 answer

, , fooobar.com/questions/212984/....

zip , .getResourceAsStream(String)

, -, , .

+1

Source: https://habr.com/ru/post/1752859/


All Articles