/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) return cachedDate.longValue(); Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } else { return date.longValue(); } }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) { return cachedDate.longValue(); } Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } return date.longValue(); }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) { return cachedDate.longValue(); } Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { date = internalParseDate(value, formats); updateParseCache(value, date); } if (date == null) { return (-1L); } return date.longValue(); }
/** * Try to parse the given date as a HTTP date. * @param value The HTTP date * @return the date as a long or <code>-1</code> if the value cannot be * parsed */ public static final long parseDate(String value) { Long cachedDate = parseCache.get(value); if (cachedDate != null) { return cachedDate.longValue(); } long date = -1; for (int i = 0; (date == -1) && (i < httpParseFormats.length); i++) { try { date = httpParseFormats[i].parse(value).getTime(); updateParseCache(value, Long.valueOf(date)); } catch (ParseException e) { // Ignore } } return date; }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) return cachedDate.longValue(); Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } return date.longValue(); }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) return cachedDate.longValue(); Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } else { return date.longValue(); } }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) return cachedDate.longValue(); Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } else { return date.longValue(); } }
/** * Try to parse the given date as a HTTP date. */ public static final long parseDate(String value, DateFormat[] threadLocalformats) { Long cachedDate = parseCache.get(value); if (cachedDate != null) { return cachedDate.longValue(); } Long date = null; if (threadLocalformats != null) { date = internalParseDate(value, threadLocalformats); updateParseCache(value, date); } else { synchronized (parseCache) { date = internalParseDate(value, formats); updateParseCache(value, date); } } if (date == null) { return (-1L); } return date.longValue(); }