|
|
@ -401,15 +401,15 @@ public final class plasmaHTCache {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean deleteFileandDirs(File obj, String msg) {
|
|
|
|
private static boolean deleteFileandDirs(File path, String msg) {
|
|
|
|
if (deleteFile(obj)) {
|
|
|
|
if (deleteFile(path)) {
|
|
|
|
log.logInfo("DELETED " + msg + " CACHE: " + obj.toString());
|
|
|
|
log.logInfo("DELETED " + msg + " CACHE: " + path.toString());
|
|
|
|
obj = obj.getParentFile();
|
|
|
|
path = path.getParentFile(); // returns null if the path does not have a parent
|
|
|
|
// If the has been emptied, remove it
|
|
|
|
// If the has been emptied, remove it
|
|
|
|
// Loop as long as we produce empty driectoriers, but stop at HTCACHE
|
|
|
|
// Loop as long as we produce empty directories, but stop at HTCACHE
|
|
|
|
while ((!(obj.equals(cachePath))) && (obj.isDirectory()) && (obj.list().length == 0)) {
|
|
|
|
while (path != null && !(path.equals(cachePath)) && path.isDirectory() && path.list().length == 0) { // NPE
|
|
|
|
if (obj.delete()) if (log.isFine()) log.logFine("DELETED EMPTY DIRECTORY : " + obj.toString());
|
|
|
|
if (path.delete()) if (log.isFine()) log.logFine("DELETED EMPTY DIRECTORY : " + path.toString());
|
|
|
|
obj = obj.getParentFile();
|
|
|
|
path = path.getParentFile(); // returns null if the path does not have a parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|