Module Lunchify
Package jku.se.export

Class JsonExporter

java.lang.Object
jku.se.export.JsonExporter

public class JsonExporter extends Object
Utility class for exporting data to a JSON file. Uses Google's Gson library to format the JSON with pretty printing.
  • Constructor Details

    • JsonExporter

      public JsonExporter()
  • Method Details

    • export

      public void export(Map<String,?> data, String baseFileName) throws IOException
      Exports the provided data map to a JSON file. The file is saved in the user's Downloads directory with a timestamped name.
      Parameters:
      data - Map containing the data to export.
      baseFileName - Base name for the output file (without extension or timestamp).
      Throws:
      IOException - if writing to file fails.