-clear-cache only deletes ehcache folders

This commit is contained in:
Reinhard Pointner 2016-03-17 09:03:22 +00:00
parent 62ec14757c
commit b243a6df1a
1 changed files with 7 additions and 5 deletions

View File

@ -85,12 +85,14 @@ public class Main {
// clear preferences and cache // clear preferences and cache
if (args.clearCache()) { if (args.clearCache()) {
System.out.println("Clear cache and temporary files"); System.out.println("Clear cache");
for (File folder : getChildren(ApplicationFolder.AppData.getCanonicalFile(), FOLDERS)) { for (File folder : getChildren(ApplicationFolder.Cache.getCanonicalFile(), FOLDERS)) {
System.out.println("* Delete " + folder); if (delete(folder)) {
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 // just clear cache and/or settings and then exit