Skip to content

Commit

Permalink
Updated gson recipe to close response body.
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-r12 committed Jan 16, 2016
1 parent c193481 commit 0f4d824
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public void run() throws Exception {
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);

Gist gist = gson.fromJson(response.body().charStream(), Gist.class);
response.body().close();

for (Map.Entry<String, GistFile> entry : gist.files.entrySet()) {
System.out.println(entry.getKey());
System.out.println(entry.getValue().content);
Expand Down

0 comments on commit 0f4d824

Please sign in to comment.