public static final void save() { try { Json json = new Json(new DataManage()); String text = json.toString(); if (text.hashCode() != hashCode) { hashCode = text.hashCode(); System.out.println("save data"); FileUtil.save(getFile(), text); Messager.send(L.get("Message.data_save") + " " + new Date().toString()); } } catch (Exception e) { e.printStackTrace(); } }
// 保存类文件到 指定文件夹 public static final void save(ClassElement classElement, File folder) { try { if (folder.exists() == false) { folder.mkdirs(); } File jsonFile = new File(folder, classElement.getObjId()); jsonFile.createNewFile(); FileUtil.save(jsonFile, new Json(classElement.getObject()).toString()); // ClassPath classPath = classElement.getParent(); Messager.send( L.get("message.class_element_save") + " " + classPath.getClassName() + " " + classElement.getObjId() + " " + new Date().toString()); } catch (Exception e) { e.printStackTrace(); } }