}
long sectionSize = OmFileHelper.getSize(streamsDir);
report.append("Recordings allocates: ").append(OmFileHelper.getHumanSize(sectionSize)).append("\n");
long size = OmFileHelper.getSize(hibernateDir);
long restSize = sectionSize - size;
FlvRecordingDao recordDao = getApplicationContext(ctxName).getBean(FlvRecordingDao.class);
long[] params = {0, 0}; // [0] == deleted [1] == missing
for (FlvRecording rec : recordDao.getAllFlvRecordings()) {
checkRecordingFile(hibernateDir, rec.getFileHash(), rec.getDeleted(), params, cleanup);
checkRecordingFile(hibernateDir, rec.getAlternateDownload(), rec.getDeleted(), params, cleanup);
checkRecordingFile(hibernateDir, rec.getPreviewImage(), rec.getDeleted(), params, cleanup);
}
long invalid = 0;
for (File f : hibernateDir.listFiles()) {
if (f.isFile() && f.getName().endsWith(".flv")) {
FlvRecording rec = recordDao.getRecordingByHash(f.getName());
if (rec == null) {
cleanUpFile(invalid, cleanup, f);
String name = f.getName().substring(0, f.getName().length() - 5);
cleanUpFile(invalid, cleanup, new File(hibernateDir, name + ".avi"));
cleanUpFile(invalid, cleanup, new File(hibernateDir, name + ".jpg"));