diff --git a/src/gdms/GDMS.java b/src/gdms/GDMS.java index 933a6bb..b0feea8 100644 --- a/src/gdms/GDMS.java +++ b/src/gdms/GDMS.java @@ -2,17 +2,19 @@ package gdms; import dao.DBManagement; import error.GExcptFileIO; +import error.GExcptFormat; import error.GExcptInit; import error.GExcptSQL; import net.sf.json.JSONObject; import utils.Utils; +import java.text.ParseException; import java.util.*; public class GDMS { static Map schedules; static String schedulePath = ""; - public static void init() throws GExcptInit { + public static void init() throws GExcptInit, GExcptFormat { initSchedule(); Timer timer = new Timer(true); for(Map.Entry schedule:schedules.entrySet()){ @@ -204,7 +206,7 @@ public class GDMS { throw new GExcptInit("GlobalTimePoint.json error"); } - private static void initSchedule() { + private static void initSchedule() throws GExcptFormat { schedules = new HashMap<>(); String sets= null; try { @@ -217,7 +219,12 @@ public class GDMS { while (it.hasNext()) { String key = (String)it.next(); Object value = jo.get(key); - //schedules.put(key, new utils.Utils.dateFormat((String) value)); + try { + schedules.put(key, Configuration.dateFormat.parse((String) value)); + } catch (ParseException e) { + e.printStackTrace(); + throw new GExcptFormat("json date format error"); + } } } }