users@jax-rs-spec.java.net

[jax-rs-spec users] Why does javax.ws.rs.core.Response not implement Closeable?

From: Steven Schlansker <stevenschlansker_at_gmail.com>
Date: Wed, 1 Oct 2014 15:18:00 -0700

Hi jax-rs users,

I am curious why Response does not implement Closeable.
That would allow all sorts of neat uses, in particular
try-with-resources:

try (Response resp = httpClient.target(Ö).get()) {
  // use resp
} // resp closed!

It may seem like a very small issue, but does impact
usability in a non-trivial way.

I didnít see a clear answer on the mailing list.
Hopefully someone can clarify.

Thanks!
Steven