File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
utils/src/main/java/org/apache/cloudstack/utils/redfish Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2929import java .security .NoSuchAlgorithmException ;
3030import java .util .Base64 ;
3131import java .util .concurrent .TimeUnit ;
32+ import java .util .stream .Collectors ;
3233
3334import javax .net .ssl .HostnameVerifier ;
3435import javax .net .ssl .HttpsURLConnection ;
@@ -340,7 +341,7 @@ protected String processGetSystemIdResponse(CloseableHttpResponse response) {
340341 try {
341342 in = response .getEntity ().getContent ();
342343 BufferedReader streamReader = new BufferedReader (new InputStreamReader (in , StandardCharsets .UTF_8 ));
343- jsonString = streamReader .readLine ( );
344+ jsonString = streamReader .lines (). collect ( Collectors . joining () );
344345 } catch (UnsupportedOperationException | IOException e ) {
345346 throw new RedfishException ("Failed to process system Response" , e );
346347 }
@@ -384,8 +385,7 @@ protected RedfishPowerState processGetSystemRequestResponse(CloseableHttpRespons
384385 try {
385386 in = response .getEntity ().getContent ();
386387 BufferedReader streamReader = new BufferedReader (new InputStreamReader (in , StandardCharsets .UTF_8 ));
387-
388- jsonString = streamReader .readLine ();
388+ jsonString = streamReader .lines ().collect (Collectors .joining ());
389389 String powerState = new JsonParser ().parse (jsonString ).getAsJsonObject ().get (POWER_STATE ).getAsString ();
390390 return RedfishPowerState .valueOf (powerState );
391391 } catch (UnsupportedOperationException | IOException e ) {
You can’t perform that action at this time.
0 commit comments