Fix gist
This commit is contained in:
1 parent
eaf7a4ec22
commit
1b28d37778
1 file changed
+4
-4
@@ -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