public class DateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void | addDateHeaderIfRequired(HttpServerExchange exchange) |
static boolean | handleIfModifiedSince(HttpServerExchange exchange, Date lastModified) Handles the if-modified-since header. |
static boolean | handleIfModifiedSince(String modifiedSince, Date lastModified) Handles the if-modified-since header. |
static boolean | handleIfUnmodifiedSince(HttpServerExchange exchange, Date lastModified) Handles the if-unmodified-since header. |
static boolean | handleIfUnmodifiedSince(String modifiedSince, Date lastModified) Handles the if-unmodified-since header. |
static Date | parseDate(String date) Attempts to pass a HTTP date. |
static String | toCommonLogFormat(Date date) |
static String | toDateString(Date date) Converts a date to a format suitable for use in a HTTP request |
static String | toOldCookieDateString(Date date) |
public static String toDateString(Date date)
date
- The datepublic static Date parseDate(String date)
date
- The date to parsepublic static boolean handleIfModifiedSince(HttpServerExchange exchange, Date lastModified)
exchange
- the exchangelastModified
- The last modified datepublic static boolean handleIfModifiedSince(String modifiedSince, Date lastModified)
modifiedSince
- the modified since datelastModified
- The last modified datepublic static boolean handleIfUnmodifiedSince(HttpServerExchange exchange, Date lastModified)
exchange
- the exchangelastModified
- The last modified datepublic static boolean handleIfUnmodifiedSince(String modifiedSince, Date lastModified)
modifiedSince
- the if unmodified since datelastModified
- The last modified datepublic static void addDateHeaderIfRequired(HttpServerExchange exchange)
Copyright © 2015 JBoss by Red Hat. All rights reserved.