GitSmartHttpTools: Open OutputStream in try-with-resource
Change-Id: Ifb50b923f58f73d323cc1492950e58b6dc39f376 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
462f04a47d
commit
6722f6927a
|
@ -314,11 +314,8 @@ private static void send(HttpServletRequest req, HttpServletResponse res,
|
|||
res.setStatus(HttpServletResponse.SC_OK);
|
||||
res.setContentType(type);
|
||||
res.setContentLength(buf.length);
|
||||
OutputStream os = res.getOutputStream();
|
||||
try {
|
||||
try (OutputStream os = res.getOutputStream()) {
|
||||
os.write(buf);
|
||||
} finally {
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue