private void processJournal ( ) throws IOException { FileUtils . deleteIfExists ( mJournalFileTmp ) ; for ( Iterator < CacheEntry > i = mLruEntries . values ( ) . iterator ( ) ; i . hasNext ( ) ; ) { CacheEntry cacheEntry = i . next ( ) ; if ( ! cacheEntry . isUnderEdit ( ) ) { mSize += cacheEntry . getSize ( ) ; } else { cacheEntry . delete ( ) ; i . remove ( ) ; } } }
Computes the initial size and collects garbage as a part of opening the cache . Dirty entries are assumed to be inconsistent and will be deleted .