Make sure Dates in response headers get serialized properly. Add expires convenience method. svn path=/trunk/; revision=448
diff --git a/src/jsr311-api/src/javax/ws/rs/core/Response.java b/src/jsr311-api/src/javax/ws/rs/core/Response.java index 980dc12..403f14b 100644 --- a/src/jsr311-api/src/javax/ws/rs/core/Response.java +++ b/src/jsr311-api/src/javax/ws/rs/core/Response.java
@@ -490,12 +490,25 @@ public abstract ResponseBuilder cacheControl(CacheControl cacheControl); /** + * Set the expires date on the ResponseBuilder. + * + * + * @param expires the expiration date + * @return the updated ResponseBuilder + */ + public abstract ResponseBuilder expires(Date expires); + + /** * Add a header to the ResponseBuilder. * * @param name the name of the header * @param value the value of the header, the header will be serialized - * using its toString method. If null then all current headers of the - * same name will be removed. + * using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate} if + * one is available via + * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)} + * for the class of {@code value} or using its toString method if a + * header delegate is not available. If {@code value} is null then all + * current headers of the same name will be removed. * @return the updated ResponseBuilder */ public abstract ResponseBuilder header(String name, Object value);
diff --git a/src/jsr311-api/src/javax/ws/rs/ext/RuntimeDelegate.java b/src/jsr311-api/src/javax/ws/rs/ext/RuntimeDelegate.java index 89942df..eca604a 100644 --- a/src/jsr311-api/src/javax/ws/rs/ext/RuntimeDelegate.java +++ b/src/jsr311-api/src/javax/ws/rs/ext/RuntimeDelegate.java
@@ -164,7 +164,7 @@ /** * Obtain an instance of a HeaderDelegate for the supplied class. An * implementation is required to support the following values for type: - * Cookie, CacheControl, EntityTag, NewCookie, MediaType. + * Cookie, CacheControl, EntityTag, NewCookie, MediaType, Date. * @param type the class of the header * @return an instance of HeaderDelegate for the supplied type */