Пример #1
0
 public static JSONObject loadXML(File f) {
   try {
     JOFile jf = new JOFile();
     return jf.xml(f, "UTF-8");
   } catch (Exception e) {
     JOLogger.error("load xml error : " + f, e);
   }
   return null;
 }
Пример #2
0
 public static JSONObject load(String base, String id) {
   File f = new File(base, id + ".json");
   try {
     JSONObject ret = load(f);
     ret.put("$parent", f.getParent());
     return ret;
   } catch (Exception ex) {
     ex.printStackTrace();
     JOLogger.error("Can't load json [" + f + "]");
   }
   return null;
 }
Пример #3
0
 public static JSONObject load(File f) {
   if (f.exists()) {
     try {
       String fname = f.getAbsolutePath();
       IJOCacheItem<JSONObject> item = cache().get(fname, new JOCacheFileItem(fname));
       return item.load();
     } catch (Exception ex) {
       JOLogger.error("Can't load jo " + f);
       ex.printStackTrace();
     }
   }
   return null;
 }