X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FCache.java;h=4750ef844f1e6593ab1f90ebd76273ddaee77497;hp=13a50ea92219663a379eb58d7956237217a3f49a;hb=f6e8d60dbb9f124046f1b951315d74f003624f09;hpb=15c2dc9f79bd9f96bb7f877f360b5761778469ae diff --git a/src/be/nikiroo/utils/Cache.java b/src/be/nikiroo/utils/Cache.java index 13a50ea..4750ef8 100644 --- a/src/be/nikiroo/utils/Cache.java +++ b/src/be/nikiroo/utils/Cache.java @@ -220,8 +220,9 @@ public class Cache { * @param allowTooOld * allow files even if they are considered too old * @param stable - * a stable file (that dones't change too often) -- parameter - * used to check if the file is too old to keep or not + * a stable file (that doesn't change too often) -- parameter + * used to check if the file is too old to keep or not in the + * cache * * @return the opened resource if found, NULL if not */ @@ -290,6 +291,8 @@ public class Cache { /** * Save the given resource to the cache. + *

+ * Will also clean the {@link Cache} from old files. * * @param in * the input data @@ -300,6 +303,7 @@ public class Cache { * in case of I/O error */ private void save(InputStream in, File cached) throws IOException { + clean(true); IOUtils.write(in, cached); }