Class JournalRescue

java.lang.Object
mekhq.campaign.roleplay.JournalRescue

public final class JournalRescue extends Object
Saves a player's journal from a campaign save that can't be loaded. The journal is read straight out of the save's XML, so it survives problems anywhere else in the file, and written next to the save as a Markdown file that can be imported into a campaign.
  • Method Details

    • rescue

      @Nullable public static File rescue(File save, Function<LocalDate,String> dateFormatter)
      Reads the journal from a save and writes it next to the save as Markdown.
      Parameters:
      save - the save file, compressed or not
      dateFormatter - formats dates for the export's headings
      Returns:
      the file written, or null if the save had no journal or it couldn't be read or written