<div dir="ltr">The problem with ResourceHandler is it doesn&#39;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.<div><br></div><div>Offering a more granular control to allow delivery of individual resources without the need of a ResourceHandler will drastically improve the flexibility of Undertow.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 2, 2017 at 4:46 PM Stuart Douglas &lt;<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would be ok with that, however why can&#39;t you just use the<br class="gmail_msg">
ResourceHandler? PathResourceManager will use transferFrom if the file<br class="gmail_msg">
is larger than a configured minimum (the transferMinSize parameter in<br class="gmail_msg">
the constructor).<br class="gmail_msg">
<br class="gmail_msg">
Stuart<br class="gmail_msg">
<br class="gmail_msg">
On Wed, Dec 28, 2016 at 1:52 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" class="gmail_msg" target="_blank">matt@matthicks.com</a>&gt; wrote:<br class="gmail_msg">
&gt; Previously I&#39;ve asked about streaming a single file back to the client and<br class="gmail_msg">
&gt; got some good insight as to how to accomplish this with `transferFrom`, but<br class="gmail_msg">
&gt; this misses out on all the extra features like resuming transfers, cached<br class="gmail_msg">
&gt; content, etc.  It would be very nice Undertow offered a static utility<br class="gmail_msg">
&gt; method to serve up File, Path, and URL providing all of this functionality<br class="gmail_msg">
&gt; that is currently contained in ResourceHandler<br class="gmail_msg">
&gt; (<a href="https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/resource/ResourceHandler.java#L155" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/server/handlers/resource/ResourceHandler.java#L155</a>).<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I don&#39;t think it would be difficult to extract all of that out of the<br class="gmail_msg">
&gt; private method and simply have ResourceHandler call the static method.<br class="gmail_msg">
&gt; Stuart, what do you think?<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; I&#39;d even be willing to do the leg-work if you&#39;d be willing to accept a PR<br class="gmail_msg">
&gt; for it.<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; _______________________________________________<br class="gmail_msg">
&gt; undertow-dev mailing list<br class="gmail_msg">
&gt; <a href="mailto:undertow-dev@lists.jboss.org" class="gmail_msg" target="_blank">undertow-dev@lists.jboss.org</a><br class="gmail_msg">
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br class="gmail_msg">
</blockquote></div>