/** * Get the HTTP format of the specified date. * @param value The date * @param threadLocalformat Ignored. The local ConcurrentDateFormat will * always be used. * @return the HTTP date * * @deprecated Unused. This will be removed in Tomcat 10 */ @Deprecated public static final String formatDate(long value, DateFormat threadLocalformat) { return formatDate(value); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate(((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate( ((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate( ((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate(((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate( ((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate( ((Date)headerValue).getTime(), null); } return headerValue.toString(); }
protected String getHeaderValueAsString(Object headerValue) { if (headerValue == null) return null; if (headerValue instanceof Date) { // return date strings (ie Last-Modified) in HTTP format, rather // than Java format return FastHttpDateFormat.formatDate( ((Date)headerValue).getTime(), null); } return headerValue.toString(); }
private static String resolveDate(final String value) { String datePattern = value; if (datePattern == null || datePattern.trim().isEmpty()) { datePattern = com.tomitribe.tribestream.util.Headers.DATE_PATTERN; } final DateFormat df = new SimpleDateFormat(datePattern, Locale.US); df.setTimeZone(TimeZone.getTimeZone("GMT")); return FastHttpDateFormat.formatDate(System.currentTimeMillis(), df); }
/** * Get a String representation of this lock token. */ public String toString() { String result = "Type:" + type + "\n"; result += "Scope:" + scope + "\n"; result += "Depth:" + depth + "\n"; result += "Owner:" + owner + "\n"; result += "Expiration:" + FastHttpDateFormat.formatDate(expiresAt, null) + "\n"; Enumeration<String> tokensList = tokens.elements(); while (tokensList.hasMoreElements()) { result += "Token:" + tokensList.nextElement() + "\n"; } return result; }
/** * Get a String representation of this lock token. */ public String toString() { String result = "Type:" + type + "\n"; result += "Scope:" + scope + "\n"; result += "Depth:" + depth + "\n"; result += "Owner:" + owner + "\n"; result += "Expiration:" + FastHttpDateFormat.formatDate(expiresAt, null) + "\n"; Enumeration<String> tokensList = tokens.elements(); while (tokensList.hasMoreElements()) { result += "Token:" + tokensList.nextElement() + "\n"; } return result; }
@Override public void addDateHeader(String name, long date) { if (format == null) { format = new SimpleDateFormat(HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } addHeader(name, FastHttpDateFormat.formatDate(date, format)); }
@Override public final String getLastModifiedHttp() { return FastHttpDateFormat.formatDate(getLastModified()); }
@Override public final String getLastModifiedHttp() { return FastHttpDateFormat.formatDate(getLastModified()); }
/** * Set the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ public void setDateHeader(String name, long value) { if (isCommitted()) return; // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } setHeader(name, FastHttpDateFormat.formatDate(value, format)); }
/* */ public void setDateHeader(String name, long value) /* */ { /* 1261 */ if (isCommitted()) { /* 1262 */ return; /* */ } /* */ /* 1265 */ if (this.included) { /* 1266 */ return; /* */ } /* */ /* 1269 */ if (this.format == null) { /* 1270 */ this.format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); /* */ /* 1272 */ this.format.setTimeZone(TimeZone.getTimeZone("GMT")); /* */ } /* */ /* 1275 */ setHeader(name, FastHttpDateFormat.formatDate(value, this.format)); /* */ } /* */
/* */ public void addDateHeader(String name, long value) /* */ { /* 989 */ if (isCommitted()) { /* 990 */ return; /* */ } /* */ /* 993 */ if (this.included) { /* 994 */ return; /* */ } /* */ /* 997 */ if (this.format == null) { /* 998 */ this.format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); /* */ /* 1000 */ this.format.setTimeZone(TimeZone.getTimeZone("GMT")); /* */ } /* */ /* 1003 */ addHeader(name, FastHttpDateFormat.formatDate(value, this.format)); /* */ } /* */
/** * Add the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ public void addDateHeader(String name, long value) { if (isCommitted()) return; // Ignore any call from an included servlet if (included) { return; } if (format == null) { format = new SimpleDateFormat(DateTool.HTTP_RESPONSE_DATE_HEADER, Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); } addHeader(name, FastHttpDateFormat.formatDate(value, format)); }
/** * Set the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void setDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) { return; } // Ignore any call from an included servlet if (included) { return; } setHeader(name, FastHttpDateFormat.formatDate(value)); }
/** * Add the specified date header to the specified value. * * @param name Name of the header to set * @param value Date value to be set */ @Override public void addDateHeader(String name, long value) { if (name == null || name.length() == 0) { return; } if (isCommitted()) { return; } // Ignore any call from an included servlet if (included) { return; } addHeader(name, FastHttpDateFormat.formatDate(value)); }