From 7a67a7fa82c931e9cc6002a4689002c9e3a25627 Mon Sep 17 00:00:00 2001 From: "Sindhuri.A" Date: Mon, 22 Apr 2019 07:43:41 +0530 Subject: Define constant for String literal Define constant for String literal BlueprintsReource class Issue-ID: SO-1490 Change-Id: Iebe6399d36d9124910facfafd18b40929ea98f02 Signed-off-by: Sindhuri.A --- .../java/org/onap/so/cloudify/v3/client/BlueprintsResource.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cloudify-client') diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/BlueprintsResource.java b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/BlueprintsResource.java index 3eae02bcee..9877eb9f43 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/BlueprintsResource.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/v3/client/BlueprintsResource.java @@ -31,6 +31,7 @@ import org.onap.so.cloudify.base.client.CloudifyRequest; public class BlueprintsResource { private final CloudifyClient client; + private static final String BLUEPRINTS_PATH = "/api/v3/blueprints/"; public BlueprintsResource(CloudifyClient client) { this.client = client; @@ -72,7 +73,7 @@ public class BlueprintsResource { // If a URL is provided, add it to the query string // If a Stream is provided, set it as the Entity body super(client, HttpMethod.PUT, - "/api/v3/blueprints/" + blueprintId + "?application_file_name=" + mainFileName + BLUEPRINTS_PATH + blueprintId + "?application_file_name=" + mainFileName + ((blueprintUrl != null) ? "&blueprint_archive=" + blueprintUrl : ""), ((blueprint != null) ? Entity.stream(blueprint) : null), Blueprint.class); } @@ -80,13 +81,13 @@ public class BlueprintsResource { public class DeleteBlueprint extends CloudifyRequest { public DeleteBlueprint(String blueprintId) { - super(client, HttpMethod.DELETE, "/api/v3/blueprints/" + blueprintId, null, Blueprint.class); + super(client, HttpMethod.DELETE, BLUEPRINTS_PATH + blueprintId, null, Blueprint.class); } } public class GetBlueprint extends CloudifyRequest { public GetBlueprint(String id, String queryArgs) { - super(client, HttpMethod.GET, "/api/v3/blueprints/" + id + queryArgs, null, Blueprint.class); + super(client, HttpMethod.GET, BLUEPRINTS_PATH + id + queryArgs, null, Blueprint.class); } } -- cgit 1.2.3-korg