added connection close in finally block
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-api@154893 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f63778b9ac
commit
06ccb8f6fd
|
@ -241,6 +241,8 @@ public class HTTPCall {
|
|||
|
||||
HttpURLConnection connection = getConnection(path, urlParameters, method, body);
|
||||
|
||||
try {
|
||||
|
||||
int responseCode = connection.getResponseCode();
|
||||
String responseMessage = connection.getResponseMessage();
|
||||
logger.info("{} {} : {} - {}",
|
||||
|
@ -282,8 +284,6 @@ public class HTTPCall {
|
|||
String res = result.toString();
|
||||
logger.trace("Server returned content : {}", res);
|
||||
|
||||
connection.disconnect();
|
||||
|
||||
if(Boolean.class.isAssignableFrom(clz)){
|
||||
return (C) ((Boolean) Boolean.valueOf(res)) ;
|
||||
}else if(ISManageable.class.isAssignableFrom(clz)){
|
||||
|
@ -291,6 +291,9 @@ public class HTTPCall {
|
|||
}
|
||||
|
||||
return (C) res;
|
||||
}finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue