<div dir="ltr">You should be able to handle all of your use cases by composing handlers together. Create a new handler that handles security or the database logic then delegates to an internal resource handler with the appropriate path.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:50 PM, Hicks, Matt <span dir="ltr">&lt;<a href="mailto:matt@matthicks.com" target="_blank">matt@matthicks.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><div class="HOEnZb"><div class="h5"><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" target="_blank">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="m_-4804665118031734248gmail_msg">
ResourceHandler? PathResourceManager will use transferFrom if the file<br class="m_-4804665118031734248gmail_msg">
is larger than a configured minimum (the transferMinSize parameter in<br class="m_-4804665118031734248gmail_msg">
the constructor).<br class="m_-4804665118031734248gmail_msg">
<br class="m_-4804665118031734248gmail_msg">
Stuart<br class="m_-4804665118031734248gmail_msg">
<br class="m_-4804665118031734248gmail_msg">
On Wed, Dec 28, 2016 at 1:52 AM, Hicks, Matt &lt;<a href="mailto:matt@matthicks.com" class="m_-4804665118031734248gmail_msg" target="_blank">matt@matthicks.com</a>&gt; wrote:<br class="m_-4804665118031734248gmail_msg">
&gt; Previously I&#39;ve asked about streaming a single file back to the client and<br class="m_-4804665118031734248gmail_msg">
&gt; got some good insight as to how to accomplish this with `transferFrom`, but<br class="m_-4804665118031734248gmail_msg">
&gt; this misses out on all the extra features like resuming transfers, cached<br class="m_-4804665118031734248gmail_msg">
&gt; content, etc.  It would be very nice Undertow offered a static utility<br class="m_-4804665118031734248gmail_msg">
&gt; method to serve up File, Path, and URL providing all of this functionality<br class="m_-4804665118031734248gmail_msg">
&gt; that is currently contained in ResourceHandler<br class="m_-4804665118031734248gmail_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="m_-4804665118031734248gmail_msg" target="_blank">https://github.com/undertow-<wbr>io/undertow/blob/master/core/<wbr>src/main/java/io/undertow/<wbr>server/handlers/resource/<wbr>ResourceHandler.java#L155</a>).<br class="m_-4804665118031734248gmail_msg">
&gt;<br class="m_-4804665118031734248gmail_msg">
&gt; I don&#39;t think it would be difficult to extract all of that out of the<br class="m_-4804665118031734248gmail_msg">
&gt; private method and simply have ResourceHandler call the static method.<br class="m_-4804665118031734248gmail_msg">
&gt; Stuart, what do you think?<br class="m_-4804665118031734248gmail_msg">
&gt;<br class="m_-4804665118031734248gmail_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="m_-4804665118031734248gmail_msg">
&gt; for it.<br class="m_-4804665118031734248gmail_msg">
&gt;<br class="m_-4804665118031734248gmail_msg">
&gt; ______________________________<wbr>_________________<br class="m_-4804665118031734248gmail_msg">
&gt; undertow-dev mailing list<br class="m_-4804665118031734248gmail_msg">
&gt; <a href="mailto:undertow-dev@lists.jboss.org" class="m_-4804665118031734248gmail_msg" target="_blank">undertow-dev@lists.jboss.org</a><br class="m_-4804665118031734248gmail_msg">
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" class="m_-4804665118031734248gmail_msg" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br class="m_-4804665118031734248gmail_msg">
</blockquote></div>
</div></div><br>______________________________<wbr>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br></blockquote></div><br></div>