aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-01-10 12:42:59 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-10 12:42:59 +0000
commit659874df80409170e57b6dd6197eb3a81eb3468e (patch)
tree08e79fd57aa0ed299586fd88f69f87a5a2f5ded1 /vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java
parent143784a849ece4fc35cc290e33f829b72bf1fc79 (diff)
parent6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 (diff)
Merge "Merge from ECOMP's repository"
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java
index 4d43d3ba2..939bfe5b6 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/SystemPropertyHelper.java
@@ -23,8 +23,10 @@ package org.onap.vid.aai.util;
import org.eclipse.jetty.util.security.Password;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.vid.aai.exceptions.InvalidPropertyException;
+import org.onap.vid.utils.Unchecked;
import java.io.UnsupportedEncodingException;
+import java.net.URI;
import java.util.Base64;
import java.util.Optional;
@@ -74,6 +76,15 @@ public class SystemPropertyHelper {
return getAAIServerUrl().orElse("") + path;
}
+ public String getFullServicePath(URI requestUri) {
+ // resolve() will merge two paths, handling the restiveness:
+ // Especially if requestUri starts with a '/' -- result will be
+ // AAI_SERVER_URL host, post, etc., and the path will be just
+ // requestUri.
+ return Unchecked.toURI(getAAIServerUrl().orElse(""))
+ .resolve(requestUri).toASCIIString();
+ }
+
public String getServiceBasePath(String path) {
return getAAIServerBaseUrl().orElse("") + path;
}