Reputation: 709
I have a URL, which contains a white-space in middle, When I invoke the new JarFile() constructor on this file, I am getting an exception "java.util.zip.ZipException: error in opening zip file"
I am trying the following url
URL url = file:/usr/local/mvn%20repo/javax/persistence/persistence-api/2.0/persistence-api-2.0.jar
and creating JarFile object
JarFile jarFile = new JarFile(url.getFile());
and getting error following error:
java.util.zip.ZipException: error in opening zip file
Thanks KK
Upvotes: 0
Views: 1501
Reputation: 35463
Try file:// as the protocol. So in total it would contain 3 slashes and look like this:
file:///usr/local/mvn%20repo/javax/persistence/persistence-api/2.0/persistence-api-2.0.jar
Upvotes: 1