report.append("\t\tbackup: ").append(OmFileHelper.getHumanSize(size)).append("\n");
//Files
File files = OmFileHelper.getUploadFilesDir();
size = OmFileHelper.getSize(files);
restSize -= size;
FileExplorerItemDao fileDao = ctx.getBean(FileExplorerItemDao.class);
invalid = 0;
deleted = 0;
for (File f : files.listFiles()) {
long fSize = OmFileHelper.getSize(f);
FileExplorerItem item = fileDao.getFileExplorerItemsByHash(f.getName());
if (item == null) {
if (cleanup) {
FileHelper.removeRec(f);
} else {
invalid += fSize;
}
} else if (item.getDeleted()) {
if (cleanup) {
FileHelper.removeRec(f);
} else {
deleted += fSize;
}
}
}
missing = 0;
for (FileExplorerItem item : fileDao.getFileExplorerItems()) {
if (!item.getDeleted() && !new File(files, item.getFileHash()).exists()) {
missing++;
}
}
report.append("\t\tfiles: ").append(OmFileHelper.getHumanSize(size)).append("\n");