code: private void cleanupBackupDir(int keep) {
          File[] backupDirFiles = getSortedBackupDirFiles();
          if (backupDirFiles.length > keep) {
              for (int i = keep; i < backupDirFiles.length; i++) {
                  backupDirFiles[i].delete();
              }
          }
      }
docs: /*
  Removes all but the most recent backup files