protected JournalInputFile openNextFile ( ) throws JournalException { File [ ] journalFiles = MultiFileJournalHelper . getSortedArrayOfJournalFiles ( journalDirectory , filenamePrefix ) ; if ( journalFiles . length == 0 ) { return null ; } JournalInputFile nextFile = new JournalInputFile ( journalFiles [ 0 ] ) ; recoveryLog . log ( "Opening journal file: '" + nextFile . getFilename ( ) + "'" ) ; return nextFile ; }
Look in the directory for files that match the prefix . If there are none leave with currentFile still null . If we find one advance into it .