/** * Try to parse the given date as a HTTP date. * @param value The HTTP date * @param threadLocalformats Ignored. The local array of * ConcurrentDateFormat will always be used. * @return the date as a long * * @deprecated Unused. This will be removed in Tomcat 10 * Use {@link #parseDate(String)} */ @Deprecated public static final long parseDate(String value, DateFormat[] threadLocalformats) { return parseDate(value); }
@Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return -1; } long date = FastHttpDateFormat.parseDate(value); if (date == -1) { throw new IllegalArgumentException(value); } return date; }
@Override public void addHeader(String name, String value) { super.addHeader(name, value); String lname = name.toLowerCase(Locale.ENGLISH); if (lname.equals(LAST_MODIFIED)) { long lastModified = FastHttpDateFormat.parseDate(value); if (lastModified != -1) { this.lastModified = lastModified; } } }
@Override public void setHeader(String name, String value) { super.setHeader(name, value); String lname = name.toLowerCase(Locale.ENGLISH); if (lname.equals(LAST_MODIFIED)) { long lastModified = FastHttpDateFormat.parseDate(value); if (lastModified != -1) { this.lastModified = lastModified; } } } }
@Override public void addHeader(String name, String value) { super.addHeader(name, value); String lname = name.toLowerCase(Locale.ENGLISH); if (lname.equals(LAST_MODIFIED)) { long lastModified = FastHttpDateFormat.parseDate(value); if (lastModified != -1) { this.lastModified = lastModified; } } }
@Override public void setHeader(String name, String value) { super.setHeader(name, value); String lname = name.toLowerCase(Locale.ENGLISH); if (lname.equals(LAST_MODIFIED)) { long lastModified = FastHttpDateFormat.parseDate(value); if (lastModified != -1) { this.lastModified = lastModified; } } } }
@Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return -1; } long date = FastHttpDateFormat.parseDate(value); if (date == -1) { throw new IllegalArgumentException(value); } return date; }
/* */ public long getDateHeader(String name) /* */ { /* 1833 */ String value = getHeader(name); /* 1834 */ if (value == null) { /* 1835 */ return -1L; /* */ } /* */ /* 1838 */ long result = FastHttpDateFormat.parseDate(value, this.formats); /* 1839 */ if (result != -1L) { /* 1840 */ return result; /* */ } /* 1842 */ throw new IllegalArgumentException(value); /* */ } /* */
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return (-1L); } // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * @return the date as a long * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return -1L; } // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) return (-1L); // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return (-1L); } // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return (-1L); } // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value, formats); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
/** * Return the value of the specified date header, if any; otherwise * return -1. * * @param name Name of the requested date header * @return the date as a long * * @exception IllegalArgumentException if the specified header value * cannot be converted to a date */ @Override public long getDateHeader(String name) { String value = getHeader(name); if (value == null) { return -1L; } // Attempt to convert the date header in a variety of formats long result = FastHttpDateFormat.parseDate(value); if (result != (-1L)) { return result; } throw new IllegalArgumentException(value); }
@Override public long getDateHeader(final String name) { final String value = getHeader(name); if (value == null) { return -1L; } final SimpleDateFormat[] formats = new SimpleDateFormat[DATE_FORMATS.length]; for (int i = 0; i < formats.length; i++) { formats[i] = SimpleDateFormat.class.cast(DATE_FORMATS[i].clone()); } final long result = FastHttpDateFormat.parseDate(value, formats); if (result != -1L) { return result; } throw new IllegalArgumentException(value); }