public void run ( ) { while ( continueBackup ) { if ( changedListVersion < changedList . getVersion ( ) ) { cleanupBackupDir ( SAVED_BACKUPS ) ; String filename = String . valueOf ( System . currentTimeMillis ( ) ) ; File persistFile = new File ( backupDir , filename ) ; backingUp = true ; changedListVersion = changedList . persist ( persistFile ) ; backingUp = false ; } sleepAndCheck ( backupFrequency ) ; } }
Runs the backup manager . Writes out files which are a backups of the changed list based on the set backup frequency . Retains SAVED_BACKUPS number of backup files removes the rest .