tags:

views:

36

answers:

1

I have been trying to implement Java WebStart but the problem I'm having is that I need to get a directory from a jar file with no luck...

I need to read the following directory:

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

When I instatiate it as:

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

it throws IllegalArgumentException.

And if I try to open the jar file in order 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 more options in order to read a directory from a jar obtained by Web Start?

Thanks in advance

+1  A: 

I couldn't exactly solve the problem, but found a workaround here in stackoverflow.

The path I followed was to put all of the files of the directory in a zip file, and then obtain the inputstream by means of .getResourceAsStream(String)

Hope this is helpful for someone, I have spent a lot of time trying to solve this.

Regards

Oso