From 05c4f401056abe16517a0b0d1ccb5841fa3dfcbb Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Sun, 14 Apr 2019 13:40:13 +0200 Subject: [PATCH] fix Cache --- src/be/nikiroo/utils/Cache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/utils/Cache.java b/src/be/nikiroo/utils/Cache.java index dbe2020..ce33592 100644 --- a/src/be/nikiroo/utils/Cache.java +++ b/src/be/nikiroo/utils/Cache.java @@ -319,8 +319,9 @@ public class Cache { * in case of I/O error */ private void save(InputStream in, File cached) throws IOException { - clean(true, dir, 10); + // We delete AFTER so not to remove the subdir we will use... IOUtils.write(in, cached); + clean(true, dir, 10); } /** -- 2.27.0