Hi Masayoshi,
I think this is a bug, although we could try to say the javadoc lets
us fail to get a fresh copy of the object. Could you please open a
jira entry for this problem?
The difficulty in fixing this is that we have several subclasses of
JarFile, NestedJarFile and UnpackedJarFile, I haven't reviewed the
behavior of clone() recently but wonder if we can make it work here.
If you would like to experiment and provide a patch that would be great.
While it is not a desirable solution you might be able to modify your
program to open new URL connections for each use of the jar file.
thanks
david jencks
On Aug 4, 2009, at 7:04 AM, Masayoshi Yamashita wrote:
Hello Jack,
I want to achieve handling JarFile and JarEntry in some programs.
Each program gets JarFile with false "useCaches", and calls
JarFile#getInputStream and JarFile#close methods.
However, when JarFile instances are same, first program closes tha
JarFile, so second program can't handle the JarFile.
Therefore I hope to get different instances.
Also, it is described in the javadoc of "useCaches" field as follows.
"If false, the protocol must always try to get a fresh copy of the
object."
I think that getJarFile method of
"org.apache.geronimo.kernel.classloader.JarFileUrlConnection" must
return a different instance, when "useCaches" is false.
I'm using Geronimo in Windows XP.
Best regards,
--------------------
Masayoshi Yamashita