cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kockert, Timo" <>
Subject AW: BinaryDataProvider
Date Tue, 18 May 2010 07:31:20 GMT

thanks for the answer!

I was already thinking about extending BinaryDataProvider. But how to I tell the framework
which provider to use for File objects, if there is more than one?


-----Urspr√ľngliche Nachricht-----
Von: Sergey Beryozkin [] 
Gesendet: Montag, 17. Mai 2010 19:17
Betreff: Re: BinaryDataProvider


On Mon, May 17, 2010 at 5:45 PM, Kockert, Timo <> wrote:

> Hello everyone,
> I am using JAX-RS and implemented a method that returns files from disk.
> The response is handled by the BinaryDataProvider because its isWriteable()
> method returns true for File objects. However getSize() only returns a
> useful length for byte arrays. I was wondering why that is?
> it is an omission

> I am asking because without the size, the response is getting chunked which
> results in at least two requests by the browser for the same file and that
> causes - imho - unnecessary load on my application.
> the workaround is to extend BinaryProvider and overwrite its getSize()
method or even create a custom provider for writing Files only which can be
more optimized, etc...

hope it helps, Sergey

> Greetings from Germany,
> Timo

View raw message