Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] Range request implementation

When I looked into this a while ago, I did not find one.

Here is how I ended up implementing it:


hope it helps.

—Z

On Sep 26, 2022, at 4:07 PM, Martynas Jusevičius <martynas@xxxxxxxxxxxxx> wrote:

Hi,

I'm looking to implement range requests with Jersey 2.x:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests

Is there a "canonical" implementation of this?

From looking at a few sources
https://colamda.de/blog/2016-07-08-files-with-jax-rs/
https://github.com/heruan/jaxrs-range-filter
I gather that the implementation involves:
* a ContainerResponseFilter (or possibly WriterInterceptor?) that
parses the Range header
* a subclass of StreamingOutput that slices the entity bytes according
to the range

Does that sound reasonable? I'd very much reuse a time-tested library however.

Martynas
atomgraph.com
_______________________________________________
jersey-dev mailing list
jersey-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jersey-dev


Back to the top