Class JsonExporter

java.lang.Object
utils.JsonExporter

public class JsonExporter extends Object
Helpers to export project metadata to JSON files. Produces prettified (indented) JSON by default and supports a compact output when desired.
  • Constructor Details

    • JsonExporter

      private JsonExporter()
      Private constructor to prevent instantiation of this utility class.
  • Method Details

    • exportProject

      public static void exportProject(Map<String,Object> projectData, String filePath) throws IOException
      Write a single project map to disk as a pretty-printed JSON object.
      Parameters:
      projectData - map with keys and values representing project fields
      filePath - destination path for JSON file
      Throws:
      IOException - on file write failure
    • exportAllProjects

      public static void exportAllProjects(List<Map<String,Object>> projects, String filePath) throws IOException
      Export a list of projects to a pretty-printed JSON array file.
      Parameters:
      projects - list of project maps
      filePath - destination path
      Throws:
      IOException - on write failure
    • exportAllProjectsCompact

      public static void exportAllProjectsCompact(List<Map<String,Object>> projects, String filePath) throws IOException
      Export projects in compact (no indentation) form suitable for smaller files.
      Parameters:
      projects - list of project maps
      filePath - destination path
      Throws:
      IOException - on write failure