@Svetlin: thanks to catch it, was intended for dev@tomcat (thanks gmail to
have completion ;))

dev@tomcat: can you check please the original question (in short:
getResourceAsStream("/some/folder")
returns a stream)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-13 13:59 GMT+02:00 Svetlin Zarev <svetlin.angelov.za...@gmail.com>:

> Hi,
>
> IMO this is a bug introduced with [1][2]. Although the root cause is in the
> bad impl. of FileResource [3] that ignores the IOException and despite the
> error, still returns a byte[] as if nothing bad happened.
>
>
> [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=60146
> [2]
> https://github.com/apache/tomcat85/blob/5768426dd27422747f2b9b4da5a092
> 7ee3328ffb/java/org/apache/catalina/webresources/CachedResource.java#L267
> [3]
> https://github.com/apache/tomcat85/blob/5768426dd27422747f2b9b4da5a092
> 7ee3328ffb/java/org/apache/catalina/webresources/FileResource.java#L203
>
> PS: Maybe this should be forwarded to the tomcat dev list ?
>
> Kind regards,
> Svetlin
>
> 2016-10-13 12:06 GMT+03:00 Romain Manni-Bucau <rmannibu...@gmail.com>:
>
> > Hi guys,
> >
> > upgrading tomee to tomcat 8.5.6 I noticed request.getServletContext().
> > getResourceAsStream(path) now returns an empty stream for / (or an
> existing
> > folder probably). Not sure it is expected or unintended.
> >
> > Reading the spec it is not that clear to me since the folder is an
> existing
> > resource but not really a webresource so not it should be considered as a
> > resource and therefore having a stream (which doesn't mean much for a
> > folder).
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com> | JavaEE Factory
> > <https://javaeefactory-rmannibucau.rhcloud.com>
> >
>

Reply via email to