X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FCache.java;h=6233082742606f72538fb5ccb2a3ffd4c64e9136;hp=779b194f5cc66f0e706865e360c6a7b992344f9d;hb=HEAD;hpb=59654e2ab1f6d3314eff438bf9e30ed6f32e5e74 diff --git a/src/be/nikiroo/utils/Cache.java b/src/be/nikiroo/utils/Cache.java index 779b194..6233082 100644 --- a/src/be/nikiroo/utils/Cache.java +++ b/src/be/nikiroo/utils/Cache.java @@ -326,9 +326,12 @@ public class Cache { * in case of I/O error */ private long save(InputStream in, File cached) throws IOException { - // We delete AFTER so not to remove the subdir we will use... - long bytes = IOUtils.write(in, cached); + // We want to force at least an immediate SAVE/LOAD to work for some + // workflows, even if we don't accept cached files (times set to "0" + // -- and not "-1" or a positive value) clean(true, dir, 10); + cached.getParentFile().mkdirs(); // in case we deleted our own parent + long bytes = IOUtils.write(in, cached); return bytes; }