Advertisement
Superloup10

JsonConfiguration.java

Dec 22nd, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package com.leviathanstudio.wolf.json;
  2.  
  3. import java.io.InputStream;
  4. import java.io.InputStreamReader;
  5.  
  6. import com.google.gson.JsonObject;
  7. import com.google.gson.JsonParser;
  8.  
  9. public class JsonConfiguration
  10. {
  11.     private static JsonObject configObj;
  12.  
  13.     public void init()
  14.     {
  15.         JsonParser parser = new JsonParser();
  16.         InputStream in = this.getClass().getResourceAsStream("/config/config.json");
  17.  
  18.         configObj = parser.parse(new InputStreamReader(in)).getAsJsonObject();
  19.         System.out.println("Config file path : " + configObj);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement