From 810639c6159ec06de3e17bdee5288affd4944b1d Mon Sep 17 00:00:00 2001 From: Andrew Gauld Date: Fri, 22 Feb 2019 20:03:11 +0000 Subject: [PATCH] Normalize to one trailing slash on Nexus URL Change-Id: Ib1c463f6c54c067ed60059dea42ff85e53ade265 Issue-ID: ACUMOS-2554 Signed-off-by: Andrew Gauld --- docs/release-notes.rst | 3 ++- .../acumos/federation/gateway/config/NexusConfiguration.java | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/release-notes.rst b/docs/release-notes.rst index e262190..46254a5 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -23,10 +23,11 @@ Federation Gateway Release Notes This server is available as a Docker image in a Docker registry at the Linux Foundation. The image name is "federation-gateway" and the tag is a version string as shown below. -Version 2.0.1, 2019-02-21 +Version 2.0.1, 2019-02-22 ------------------------- * Add catalogId field in solution search selector (`ACUMOS-2285 `_) +* Normalize configured Nexus URL to have exactly one trailing slash (`ACUMOS-2554 `_) Version 2.0.0, 2019-02-20 ------------------------- diff --git a/gateway/src/main/java/org/acumos/federation/gateway/config/NexusConfiguration.java b/gateway/src/main/java/org/acumos/federation/gateway/config/NexusConfiguration.java index 66e988c..adbe69f 100644 --- a/gateway/src/main/java/org/acumos/federation/gateway/config/NexusConfiguration.java +++ b/gateway/src/main/java/org/acumos/federation/gateway/config/NexusConfiguration.java @@ -2,7 +2,7 @@ * ===============LICENSE_START======================================================= * Acumos * =================================================================================== - * Copyright (C) 2017 AT&T Intellectual Property & Tech Mahindra. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property & Tech Mahindra. All rights reserved. * =================================================================================== * This Acumos software file is distributed by AT&T and Tech Mahindra * under the Apache License, Version 2.0 (the "License"); @@ -84,9 +84,15 @@ public class NexusConfiguration { this.url = new URL(theSpec); } + + /** + * Get the normalized URL for the nexus content server. + * @return the URL, as a String, with exactly one trailing slash. + */ + public String getUrl() { - return this.url.toString(); - } + return this.url.toString().replaceAll("/*$", "") + "/"; + } public void setUsername(String theUsername) { this.username = theUsername; -- 2.16.6