From b243a6df1acce925a5ba2ae764f5a077412b2cc0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 17 Mar 2016 09:03:22 +0000 Subject: [PATCH] -clear-cache only deletes ehcache folders --- source/net/filebot/Main.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 87ca4333..e4b21f1b 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -85,12 +85,14 @@ public class Main { // clear preferences and cache if (args.clearCache()) { - System.out.println("Clear cache and temporary files"); - for (File folder : getChildren(ApplicationFolder.AppData.getCanonicalFile(), FOLDERS)) { - System.out.println("* Delete " + folder); - delete(folder); + System.out.println("Clear cache"); + for (File folder : getChildren(ApplicationFolder.Cache.getCanonicalFile(), FOLDERS)) { + if (delete(folder)) { + System.out.println("* Delete " + folder); + } else { + System.out.println("* Failed to delete " + folder); + } } - CacheManager.getInstance().clearAll(); } // just clear cache and/or settings and then exit