"alesj" wrote :
| But in the case of jar file, see 2nd test in URLExistsUnitTestCase, I cannot do the
same hack, since it complains about not specifying the entry:
|
| | java.io.IOException: no entry name specified
| | at
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:129)
| | at
org.jboss.test.virtual.test.URLExistsUnitTestCase.testJarURLs(URLExistsUnitTestCase.java:102)
| |
For the top level jar file you should be using the file: url not the jar: url
A top level jar is a file :-)
There used to be a HACK in the VFS JAR code that worked around this issue,
i.e. it reworked the URL based on the parent but I don't see it in the current
codebase?
It probably got removed when the url handling was reworked?
Also you need to be careful with JAR files and their URL connections.
The JDK caches them internally and can even mmap them on some operating systems.
So testing a jar entry has changed isn't the same thing as checking the top level
file
changed.
Additionally, closing the top jar connection will close the cached version
which can lead to strange errors.
The internal caching is the source of the problems (e.g. locking on windows)
and something Sun have consistently refused to fix. :-(
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145769#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...