From 8f1723f9a9bb88b33c2b5aca6344630091b75f93 Mon Sep 17 00:00:00 2001 From: io42630 Date: Fri, 23 Feb 2024 15:50:29 +0100 Subject: [PATCH] move some logic to Misc --- src/main/java/com/olexyn/burnsmail/MiscU.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/olexyn/burnsmail/MiscU.java b/src/main/java/com/olexyn/burnsmail/MiscU.java index 9bb647d..be9a15a 100644 --- a/src/main/java/com/olexyn/burnsmail/MiscU.java +++ b/src/main/java/com/olexyn/burnsmail/MiscU.java @@ -1,6 +1,9 @@ package com.olexyn.burnsmail; import lombok.experimental.UtilityClass; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; import javax.mail.Folder; import javax.mail.MessagingException; @@ -46,4 +49,10 @@ public class MiscU { targetFolder.open(READ_WRITE); return targetFolder; } + + public static JSONObject deserializeJson(String json) throws ParseException { + JSONParser parser = new JSONParser(); + return (JSONObject) parser.parse(json); + + } }