*/
private int calculateNukeSize(File nukedDir, HashMap<String, Long> victims) {
int totalBytesNuked = 0;
Directory dir = ServiceManager.getServices().getMetadataHandler().getDirectory(nukedDir);
Metadata metadata;
Long bytesForUser;
for (File file : nukedDir.listFiles(new ForbiddenFilesFilter())) {
if (file.isDirectory()) {
totalBytesNuked += calculateNukeSize(file, victims);
} else {
totalBytesNuked += file.length();
metadata = dir.getMetadata(file.getName());
if (metadata != null) { // if there's no user information for this file, then we don't do anything about it
bytesForUser = victims.get(metadata.getUsername());
if (bytesForUser == null) {
bytesForUser = 0L;
}
victims.put(metadata.getUsername(), bytesForUser + file.length()); // update the value for the user
}
}
}
return totalBytesNuked;
}