Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // File consists of json objects
  2. FileInputStream inputStream = null;
  3. Scanner sc = null;
  4. try {
  5. inputStream = new FileInputStream(file_path);
  6. sc = new Scanner(inputStream, "UTF-8");
  7. while (sc.hasNextLine()) {
  8. String line = sc.nextLine();
  9. JsonObject json = new JsonParser().parse(line).getAsJsonObject();
  10. //...
  11. }
  12. inputStream.close();
  13. sc.close();
  14. } catch (Exception e) {
  15. logger.error("Error occured while indexing observations dump file.", e);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement