aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-12-20 23:04:44 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2018-12-20 23:04:54 +0530
commit62e62331a294052109f02686e4529fe613355990 (patch)
tree5ef90641c271ab04ca93e26b34d156e2dc153c6f
parent2e0e98c12d384ed2ccdff85a543439f2b40f1f2f (diff)
Sonar fix: AdditionalHeaderWebTarget.java
Fixed sonar issues/code-smells across this file Issue-ID: CCSDK-868 Change-Id: I9a6d0d7791838bf8bc524c7b108df3752cc1a24c Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r--restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java
index 1a0ddbc5..3213cae1 100644
--- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java
+++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/AdditionalHeaderWebTarget.java
@@ -3,6 +3,8 @@
* ONAP - CCSDK
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ *
+ * Modifications Copyright © 2018 IBM
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +37,8 @@ class AdditionalHeaderWebTarget implements WebTarget {
private WebTarget base;
private String token;
+ private String accessToken = "X-ACCESS-TOKEN";
+
public AdditionalHeaderWebTarget(WebTarget target, String token) {
base = target;
this.token = token;
@@ -42,17 +46,17 @@ class AdditionalHeaderWebTarget implements WebTarget {
@Override
public Invocation.Builder request() {
- return base.request().header("X-ACCESS-TOKEN", token);
+ return base.request().header(accessToken, token);
}
@Override
public Invocation.Builder request(String... acceptedResponseTypes) {
- return base.request().header("X-ACCESS-TOKEN", token);
+ return base.request().header(accessToken, token);
}
@Override
public Invocation.Builder request(MediaType... acceptedResponseTypes) {
- return base.request().header("X-ACCESS-TOKEN", token);
+ return base.request().header(accessToken, token);
}
@Override