/** * The default behavior of this method is to call * <code>getCacheControl()</code> on the wrapped response object. */ public CacheControl getCacheControl() { return response.getCacheControl(); }
public CacheControl getCacheControl() { return wrappedResourceResponse.getCacheControl(); }
public CacheControl getCacheControl() { return wrappedResourceResponse.getCacheControl(); }
/** * Checks if resource has expired. * * @param sOriginalDate the original date * @param resourceResponse the resource response * @return true, if is resource expired */ public boolean isResourceExpired(String sOriginalDate, ResourceResponse resourceResponse, String refreshMs) { boolean isExpired = true; if (sOriginalDate != null) { SimpleDateFormat inputFormater = new SimpleDateFormat("EEE, yyyy-MM-dd'T'HH:mm:ss.SS'Z'", Locale.ENGLISH); inputFormater.setTimeZone(TimeZone.getTimeZone("GMT")); try { Date originalDate = inputFormater.parse(sOriginalDate); if (System.currentTimeMillis() < (originalDate.getTime() + (resourceResponse.getCacheControl().getExpirationTime() * 1000))) { if ((refreshMs == null) || (Long.parseLong(refreshMs) < originalDate.getTime())) { isExpired = false; } } } catch (Exception e) { // Do nothing } } return isExpired; }