X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2FCache.java;h=40ce15efec98860c559177dc0734c3b68377f797;hp=f7e1a81ad0699f70d46b6f03edd53574b3319d37;hb=211f7ddb50f68aa8a999023ef6d63d5756bdace6;hpb=326093dc53fa48019c94f59bd006b307d755b392 diff --git a/src/be/nikiroo/fanfix/Cache.java b/src/be/nikiroo/fanfix/Cache.java index f7e1a81..40ce15e 100644 --- a/src/be/nikiroo/fanfix/Cache.java +++ b/src/be/nikiroo/fanfix/Cache.java @@ -396,16 +396,21 @@ public class Cache { * * @param url * the resource to open + * @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 * * @return the opened resource if found, NULL i not * * @throws IOException * in case of I/O error */ - private InputStream load(URL url, boolean allowOld, boolean stable) + private InputStream load(URL url, boolean allowTooOld, boolean stable) throws IOException { File cached = getCached(url); - if (cached.exists() && !isOld(cached, stable)) { + if (cached.exists() && (allowTooOld || !isOld(cached, stable))) { return new MarkableFileInputStream(new FileInputStream(cached)); }