Class JsonExporter
java.lang.Object
utils.JsonExporter
Helpers to export project metadata to JSON files. Produces prettified
(indented) JSON by default and supports a compact output when desired.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation of this utility class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidExport a list of projects to a pretty-printed JSON array file.static voidExport projects in compact (no indentation) form suitable for smaller files.static voidexportProject(Map<String, Object> projectData, String filePath) Write a single project map to disk as a pretty-printed JSON object.
-
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 IOExceptionWrite a single project map to disk as a pretty-printed JSON object.- Parameters:
projectData- map with keys and values representing project fieldsfilePath- destination path for JSON file- Throws:
IOException- on file write failure
-
exportAllProjects
public static void exportAllProjects(List<Map<String, Object>> projects, String filePath) throws IOExceptionExport a list of projects to a pretty-printed JSON array file.- Parameters:
projects- list of project mapsfilePath- destination path- Throws:
IOException- on write failure
-
exportAllProjectsCompact
public static void exportAllProjectsCompact(List<Map<String, Object>> projects, String filePath) throws IOExceptionExport projects in compact (no indentation) form suitable for smaller files.- Parameters:
projects- list of project mapsfilePath- destination path- Throws:
IOException- on write failure
-