Related to this issue: ClassLoader only has getResource(path) and
getResourceAsStream(url) and no means to determine the file size or
modify date. Usually you (and we as well) use File or URL for that.
But neither File nor URL allow you to specify the classloader. If that
is true, than we can completely ignore the ClassLoader while loading
resource files. However why did we introduce it than? I guess because
we had resource loading issue which we thought were classloader
related. Has our implementation significantly changed since than so
that resource loading only now is independent of the classloader? J2EE
and servlet container mail archives are full of classloader issues.
Are these issues only related to classes (not including resource
files)?

Juergen

On 1/1/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
fine by me

On 1/1/07, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
>
> While working on improving resource loading I came across the following
> issue:
>
> IResourceFinder: URL find(String path);
>
> xxxResourceStreamLocator: IResourceStream locate(Class, String path)
>
> locate(..)
> {
>   URL file = finder.find(path)
>   if (file != null)
>   {
>      IResourceStream stream = new UrlResourceStream(file)
>   }
> }
>
> The implicit assumption is that if 'file' != null than 'stream' will
> be != null as well. But that doesn't seem to be true, I did some
> tests. The reason being that the classloader used by the
> ResourceFinder may not be the one used by new UrlResourceStream().
>
> solution: change find() to return an IResourceStream instead of a URL
>
> any other idea?
>
> Juergen
>


Reply via email to