[undertow-dev] Resource Handling Revisited

Hicks, Matt matt at matthicks.com
Mon Jan 2 21:50:11 EST 2017


The problem with ResourceHandler is it doesn't easily support more complex
scenarios.  A few examples: security on resources, URLs that must find a
resource path from the database, conditional resources (deliver resource A
if the IP is x.x.x.x and resource B otherwise), etc.

Offering a more granular control to allow delivery of individual resources
without the need of a ResourceHandler will drastically improve the
flexibility of Undertow.

On Mon, Jan 2, 2017 at 4:46 PM Stuart Douglas <sdouglas at redhat.com> wrote:

> I would be ok with that, however why can't you just use the
> ResourceHandler? PathResourceManager will use transferFrom if the file
> is larger than a configured minimum (the transferMinSize parameter in
> the constructor).
>
> Stuart
>
> On Wed, Dec 28, 2016 at 1:52 AM, Hicks, Matt <matt at matthicks.com> wrote:
> > Previously I've asked about streaming a single file back to the client
> and
> > got some good insight as to how to accomplish this with `transferFrom`,
> but
> > this misses out on all the extra features like resuming transfers, cached
> > content, etc.  It would be very nice Undertow offered a static utility
> > method to serve up File, Path, and URL providing all of this
> functionality
> > that is currently contained in ResourceHandler
> > (
> https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/resource/ResourceHandler.java#L155
> ).
> >
> > I don't think it would be difficult to extract all of that out of the
> > private method and simply have ResourceHandler call the static method.
> > Stuart, what do you think?
> >
> > I'd even be willing to do the leg-work if you'd be willing to accept a PR
> > for it.
> >
> > _______________________________________________
> > undertow-dev mailing list
> > undertow-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/undertow-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20170103/4be6edf6/attachment.html 


More information about the undertow-dev mailing list