X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FDataLoader.java;h=e4f40a30289548069c9fb6a4c3b4c17d6136bdc2;hb=085a2f9a3a811a910de7c3011eb6f5ef2ab18aa0;hp=ef115c9d60a9b647147fe3dff06c9bf5d95a6283;hpb=f1fb834c62f9d9a73edeeda3fed060e0dede8cef;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/DataLoader.java b/src/be/nikiroo/fanfix/DataLoader.java index ef115c9..e4f40a3 100644 --- a/src/be/nikiroo/fanfix/DataLoader.java +++ b/src/be/nikiroo/fanfix/DataLoader.java @@ -231,6 +231,8 @@ public class DataLoader { ImageIO.write(ImageUtils.fromStream(in), Instance.getConfig() .getString(Config.IMAGE_FORMAT_CONTENT).toLowerCase(), target); + } catch (IOException e) { + throw new IOException("Cannot write image " + url, e); } finally { in.close(); } @@ -266,6 +268,18 @@ public class DataLoader { return cache.load(uniqueID, true, true); } + /** + * Remove the given resource from the cache. + * + * @param uniqueID + * a unique ID used to locate the cached resource + * + * @return TRUE if it was removed + */ + public boolean removeFromCache(String uniqueID) { + return cache.remove(uniqueID); + } + /** * Clean the cache (delete the cached items). *