Skip to content

Commit

Permalink
Merge pull request #81 from ivan1767p/closestream
Browse files Browse the repository at this point in the history
Close stream for Http methods
  • Loading branch information
jmecosta committed Jan 29, 2022
2 parents c60d889 + 0f77e69 commit ea25ebb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/trimble/tekla/teamcity/HttpConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ public String Get(TeamcityConfiguration conf, String url, Settings settings, Str
}

TeamcityLogger.logMessage(settings, repoName, "[HttpConnector][Get] Hook Reply: " + line);
in.close();
content.close();

return dataout.toString();
return dataout.toString();
}

public String Get(String url, Settings settings, String repoName) throws MalformedURLException, IOException {
Expand All @@ -127,6 +129,8 @@ public String Get(String url, Settings settings, String repoName) throws Malform
}

TeamcityLogger.logMessage(settings, repoName, "[HttpConnector][Get] Hook Reply: " + line);
in.close();
content.close();
return dataout.toString();
}

Expand Down Expand Up @@ -159,6 +163,8 @@ public String PostPayload(TeamcityConfiguration conf, String url, String payload
}

TeamcityLogger.logMessage(settings, repoName, "[HttpConnector][PostPayload] Hook Reply: " + line);
in.close();
content.close();
return line;
} catch (Exception e) {
TeamcityLogger.logMessage(settings, repoName, "[HttpConnector][PostPayload] Hook Exception: " + e.getMessage());
Expand Down

0 comments on commit ea25ebb

Please sign in to comment.