aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/rest
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-10-14 14:25:58 +0100
committerliamfallon <liam.fallon@est.tech>2019-10-14 16:36:47 +0100
commite940ccf7d38373c145b5d5f4a95603edaa089796 (patch)
treeb762cf9aeb4fcee6f79cfe8fbb81a70722d51378 /models-interactions/model-impl/rest
parentccebb3497292cfa831ad7cdc7ee7739a0d94a70c (diff)
Clean up minor things in policy-models
Cleam up of some minor eclipse, checkstyle, and Sonar issues in policy-models Issue-ID: POLICY-2165 Change-Id: Id5682fd60e1a6cebbf716d9c258453aa53ca2482 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-interactions/model-impl/rest')
-rw-r--r--models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java b/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
index 2ee47a9fc..643c629b3 100644
--- a/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
+++ b/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
@@ -41,9 +41,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RestManager {
-
private static final Logger logger = LoggerFactory.getLogger(RestManager.class);
+ // Constants for string literals
+ private static final String CONTENT_TYPE = "Content-Type";
+
public class Pair<A, B> {
public final A first;
public final B second;
@@ -69,7 +71,7 @@ public class RestManager {
Map<String, String> headers, String contentType, String body) {
HttpPut put = new HttpPut(url);
addHeaders(put, username, password, headers);
- put.addHeader("Content-Type", contentType);
+ put.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);
@@ -96,7 +98,7 @@ public class RestManager {
Map<String, String> headers, String contentType, String body) {
HttpPost post = new HttpPost(url);
addHeaders(post, username, password, headers);
- post.addHeader("Content-Type", contentType);
+ post.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);
@@ -141,7 +143,7 @@ public class RestManager {
HttpDeleteWithBody delete = new HttpDeleteWithBody(url);
addHeaders(delete, username, password, headers);
if (body != null && !body.isEmpty()) {
- delete.addHeader("Content-Type", contentType);
+ delete.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);