Index: jersey-client/src/main/java/com/sun/jersey/api/client/ClientResponse.java =================================================================== --- jersey-client/src/main/java/com/sun/jersey/api/client/ClientResponse.java (revision 2130) +++ jersey-client/src/main/java/com/sun/jersey/api/client/ClientResponse.java Mon Mar 23 20:35:25 MDT 2009 @@ -52,6 +52,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.StringTokenizer; import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; @@ -152,13 +153,41 @@ * Get the HTTP headers of the response. * * @return the HTTP headers of the response. + * @deprecated */ + @Deprecated public MultivaluedMap getMetadata() { return headers; } /** + * Get the HTTP headers of the response. - * + * + * @return the HTTP headers of the response. + */ + public MultivaluedMap getHeaders() { + return headers; + } + + /** + * Get the allowed HTTP methods. + * + * @return the HTTP allowed methods. + */ + public List getAllow() { + List allowedMethods = new ArrayList(); + String allow = headers.getFirst("Allow"); + if (allow != null) { + StringTokenizer tokenizer = new StringTokenizer(allow, ","); + while (tokenizer.hasMoreTokens()) { + allowedMethods.add(tokenizer.nextToken()); + } + } + return allowedMethods; + } + + /** + * * @return true if there is an entity present in the response. */ public boolean hasEntity() {