MCPcopy Create free account
hub / github.com/TheCyaniteProject/exit_code_java / getJSON

Method getJSON

src/main/java/exitcode/Patreon.java:64–81  ·  view source on GitHub ↗
(String prefix, Integer suffix)

Source from the content-addressed store, hash-verified

62 }
63
64 private static JSONObject getJSON(String prefix, Integer suffix) { // Move to ExitParser later
65 try
66 {
67 URL url = new URL(prefix.concat(suffix.toString()));
68 HttpURLConnection connection = (HttpURLConnection) url.openConnection();
69 BufferedReader stream = new BufferedReader(new InputStreamReader(connection.getInputStream()));
70 StringBuilder result = new StringBuilder();
71 String line;
72 while ((line = stream.readLine()) != null) {
73 result.append(line);
74 }
75 stream.close();
76 return new JSONObject(result.toString());
77 }
78 catch (MalformedURLException e) {}
79 catch (IOException e) {}
80 return null;
81 }
82
83 private static JSONObject getJSON(String prefix, String suffix, String _accessToken) { // Move to ExitParser later
84 try {

Callers 1

updatePatronListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected