* ============LICENSE_START==========================================
* ONAP Portal
* ===================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
} finally {
try {
+ if(in!=null) {
in.close();
+ }
con.disconnect();
} catch (IOException e) {
logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed to close", e);
in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
String inputLine;
- while ((inputLine = in.readLine()) != null)
+ while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
+ }
JSONObject jObject = new JSONObject(response.toString()); // json
JSONArray jsonUsers = jObject.getJSONArray("response"); // get
// data
logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
} finally {
try {
+ if(in!=null) {
in.close();
con.disconnect();
+ }
} catch (IOException e) {
logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed to close", e);
}