[Jersey] Re: About file size upload limit with Jersey

From: <>
Date: Tue, 04 Mar 2014 11:56:44 +0200

Since the client's POST body is read from an InputStream that's given to
the method handling the request, you could use Guava
<>'s ByteStreams.limit(..)
to limit the maximum amount of bytes that can be read from the body.

Other's can chime in if there are different ways to handle file uploads,
or if Jersey has such funtionality built-it. Off-topic, but regarding
alleviating the effects of DDoS, there's CloudFlare
<> for example.

On 4.3.2014 7:03, hcy炎 wrote:
> Hi, Dear Jersey team,
> Recently my company is using Jersey for restful apis, and now we find
> it very useful. But now we want limit the file upload size because of
> DDos. So I want to ask about whether we can limit the file upload size
> based on the url's difference by using Jersey.
> Hope to hear from you!
> Thanks.