/** * @throws IOException */ private void cleanupOldStoreFiles() throws IOException { int maxFiles = (int) Math.ceil(m_maxStoreSize / m_maxFileSize); File[] storeFiles = getStoreFiles(); if (storeFiles.length > maxFiles) { // we've exceeded our total storage limit... int deleteTo = storeFiles.length - maxFiles; // delete the files... for (int i = 0; i < deleteTo; i++) { storeFiles[i].delete(); } } }