private boolean purgeOldFiles ( long total ) { boolean result = false ; // Should delete some files. if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisClass , "purgeOldFiles" , "total: " + total + " listSz: " + fileList . size ( ) ) ; } while ( total > 0 && fileList . size ( ) > 1 ) { FileDetails details = purgeOldestFile ( ) ; if ( details != null ) { if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisClass , "purgeOldFiles" , "Purged: " + details . file . getPath ( ) + " sz: " + details . size ) ; } total -= details . size ; result = true ; } } return result ; }
Removes old files from the repository . This method does not remove the most recent file . This method should be called while holding a lock on fileList .