Jacobvu84 / selenium-vietnam-training-course

Questions Tracking
7 stars 5 forks source link

Read file json common #33

Closed nguyendinhthuan789 closed 6 years ago

nguyendinhthuan789 commented 6 years ago

Hi all: mình làm 1 method read json ntn: public JSONObject parseContent(String dir) throws Exception { File file = new File(System.getProperty("user.dir") + dir); String content = FileUtils.readFileToString(file, "utf-8"); return new JSONObject(content); }

xong qua main gọi: public static void main(String[] args) { try{ JsonRead read=new JsonRead(); read.parseContent("lib/abc.json"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }

Error path.. mọi người help cs ạ Thanks

caodangtinh commented 6 years ago

bạn có thể cho mình xem cấu trúc thư mục và full log error được không, như vậy sẽ dễ dàng tìm bug hơn

nguyendinhthuan789 commented 6 years ago

@Thank @caodangtinh mình sửa dc rùi. mình parse nhưng chưa in!