diff options
Diffstat (limited to 'openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java')
-rw-r--r-- | openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java index 41466a6..468e859 100644 --- a/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java +++ b/openstack-client-connectors/http-connector/src/main/java/com/woorea/openstack/connector/HttpClientResponse.java @@ -14,28 +14,6 @@ * ============LICENSE_END========================================================= */ -/* - * ============LICENSE_START========================================== - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * - * ECOMP and OpenECOMP are trademarks - * and service marks of AT&T Intellectual Property. - * - */ package com.woorea.openstack.connector; @@ -57,21 +35,21 @@ import java.util.Map; public class HttpClientResponse implements OpenStackResponse { private static Logger LOGGER = LoggerFactory.getLogger(HttpClientConnector.class); - + private HttpResponse response = null; private String entityBody = null; public HttpClientResponse(HttpResponse response) { this.response = response; - + // Read the body so InputStream can be closed if (response.getEntity() == null) { // No body LOGGER.debug ("No Response Body"); return; } - + ByteArrayOutputStream responseBody = new ByteArrayOutputStream(); try { response.getEntity().writeTo(responseBody); @@ -82,7 +60,7 @@ public class HttpClientResponse implements OpenStackResponse { LOGGER.debug (entityBody); } - + @Override public <T> T getEntity (Class<T> returnType) { // Get appropriate mapper, based on existence of a root element @@ -104,7 +82,7 @@ public class HttpClientResponse implements OpenStackResponse { @Override public InputStream getInputStream() { - return new ByteArrayInputStream (entityBody.getBytes()); + return new ByteArrayInputStream (entityBody.getBytes()); } @Override @@ -124,4 +102,4 @@ public class HttpClientResponse implements OpenStackResponse { return headers; } -} +}
\ No newline at end of file |