@Override public void ImportWarningCategories() { List<WarningCategory> warningCategories = new ArrayList<WarningCategory>(); try { Reader reader = new InputStreamReader( AdminServiceImpl.class .getClassLoader() .getResourceAsStream("mongo/warningCategories.json")); warningCategories = new Gson().fromJson(reader, new TypeToken<List<WarningCategory>>() {}.getType()); } catch (JsonSyntaxException e) { log.error(e.getMessage(), e); throw new MedCheckerException(e.getMessage()); } catch (JsonIOException e) { log.error(e.getMessage(), e); throw new MedCheckerException(e.getMessage()); } warningRepo.insert(warningCategories); }
@Override public List<WarningCategory> getWarningCategories() { return warningRepo.fetchValidWarnings(); }