/** {@inheritDoc} */ public boolean isCacheable() { Image img = getInfo().getOriginalImage(); if (img == null) { return true; } return img.isCacheable(); }
/** * Registers an image with the cache. * @param img the image */ public void putImage(Image img) { String originalURI = img.getInfo().getOriginalURI(); if (originalURI == null || "".equals(originalURI)) { return; //Don't cache if there's no URI } //An already existing Image is replaced. if (!img.isCacheable()) { throw new IllegalArgumentException( "Image is not cacheable! (Flavor: " + img.getFlavor() + ")"); } ImageKey key = new ImageKey(originalURI, img.getFlavor()); images.put(key, img); }
if (img.isCacheable()) { lastCacheableImage = img; if (img.isCacheable()) { lastCacheableImage = img;
throw e; if (info.getOriginalImage() == null || info.getOriginalImage().isCacheable()) { putImageInfo(info);