@Override
    public void prepareToWriteJournalEntry() throws JournalException {
        if (open) {
            currentJournal.closeIfAppropriate();

            if (!currentJournal.isOpen()) {
                currentJournal =
                        new JournalOutputFile(this,
                                              filenamePrefix,
                                              journalDirectory,
                                              sizeLimit,
                                              ageLimit);
            }
        }
    }
@ Override public void prepareToWriteJournalEntry ( ) throws JournalException { if ( open ) { currentJournal . closeIfAppropriate ( ) ; if ( ! currentJournal . isOpen ( ) ) { currentJournal = new JournalOutputFile ( this , filenamePrefix , journalDirectory , sizeLimit , ageLimit ) ; } } }
Before writing an entry, check to see whether we need to close the
current file and/or open a new one.