dev@jersey.java.net

[Jersey][WebDAV] is Response.status(WebDavStatus) needed?

From: Markus KARG <markus.karg_at_gmx.net>
Date: Sun, 25 Jan 2009 19:03:28 +0100

WebDAV defines several not HTTP status codes, which currently I have covered
with my own enum. Unfortunately Response.status() does only accept int or
JAX-RS Response.Status (not anything else, e.g . like "everything
implementing a hypothetical Status interface" which would allow for
extensibility).

 

So currently to return a WebDav status code, one must write:

 

return Response.status(ResponseStatus.INSUFFICIENT_STORAGE.getStatusCode())

 

what is not sice nice, since the "getStatusCode()" method must be called to
transform the enum into an int.

 

To solve this, in JAX-RS there is no other solution that to not use Response
but WebDavResponse -- which has to be implemented exactly like Response,
what is a lot of double code and work... :-(

 

So the question is: Is it really annoying that "getStatusCode()" must be
written or do I worry too much about this inconvenience?

 

What do you think? Can we live with that, or is a WebDavResponse class
needed...?

 

Thanks!

Markus