Package io.undertow.util
Class DateUtils
java.lang.Object
io.undertow.util.DateUtils
Utility for parsing and generating dates
- Author:
- Stuart Douglas
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDateHeaderIfRequired
(HttpServerExchange exchange) static String
getCurrentDateTime
(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
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 requeststatic String
toOldCookieDateString
(Date date)
-
Method Details
-
toDateString
Converts a date to a format suitable for use in a HTTP request- Parameters:
date
- The date- Returns:
- The RFC-1123 formatted date
-
toOldCookieDateString
-
toCommonLogFormat
-
parseDate
Attempts to pass a HTTP date.- Parameters:
date
- The date to parse- Returns:
- The parsed date, or null if parsing failed
-
handleIfModifiedSince
Handles the if-modified-since header. returns true if the request should proceed, false otherwise- Parameters:
exchange
- the exchangelastModified
- The last modified date- Returns:
-
handleIfModifiedSince
Handles the if-modified-since header. returns true if the request should proceed, false otherwise- Parameters:
modifiedSince
- the modified since datelastModified
- The last modified date- Returns:
-
handleIfUnmodifiedSince
Handles the if-unmodified-since header. returns true if the request should proceed, false otherwise- Parameters:
exchange
- the exchangelastModified
- The last modified date- Returns:
-
handleIfUnmodifiedSince
Handles the if-unmodified-since header. returns true if the request should proceed, false otherwise- Parameters:
modifiedSince
- the if unmodified since datelastModified
- The last modified date- Returns:
-
addDateHeaderIfRequired
-
getCurrentDateTime
-