Fix gist
This commit is contained in:
@@ -31,25 +31,25 @@ public class GistProvider {
|
||||
private String password;
|
||||
|
||||
private GistProvider() {
|
||||
this.gistList = listAllGists();
|
||||
readConfig();
|
||||
this.gistList = listAllGists();
|
||||
}
|
||||
|
||||
private void readConfig() {
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
URL url = Resources.getResource("Gist_Config.json");
|
||||
JSONObject gistConfig;
|
||||
JSONObject gistConfig = null;
|
||||
|
||||
try {
|
||||
String jsonConfig = Resources.toString(url, StandardCharsets.UTF_8);
|
||||
//Read JSON file
|
||||
gistConfig = (JSONObject) jsonParser.parse(jsonConfig);
|
||||
this.username = gistConfig.get("username").toString();
|
||||
this.password = gistConfig.get("password").toString();
|
||||
|
||||
} catch (IOException | ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.username = gistConfig.get("username").toString();
|
||||
this.password = gistConfig.get("password").toString();
|
||||
}
|
||||
|
||||
public static GistProvider getInstance() {
|
||||
|
||||
Reference in New Issue
Block a user