summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-04-28 16:36:50 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-28 16:36:50 +0000
commit746962d1b9e1aa7399436151fbb35c4efb0347f2 (patch)
tree2d2c21d92228c3a853c17824edc5edd4fee9d19f
parentaefb6fd6b91be3aa44b5e8183fa1c9e471853c29 (diff)
parentefb0b6d9d10458635193195764efac48d825441f (diff)
Merge "Update encoding library used"
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java9
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java9
2 files changed, 14 insertions, 4 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java
index b98811c490..740eb778b0 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/GlanceClientImpl.java
@@ -20,13 +20,14 @@
package org.onap.so.openstack.utils;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import org.springframework.web.util.UriUtils;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.glance.Glance;
import com.woorea.openstack.glance.model.Images;
@@ -72,7 +73,11 @@ public class GlanceClientImpl extends MsoCommonUtils {
try {
String encodedName = null;
if (name != null) {
- encodedName = UriUtils.encodeQueryParam(name, "UTF-8");
+ try {
+ encodedName = URLEncoder.encode(name, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ logger.error("error encoding query parameter: {}", encodedName);
+ }
}
Glance glanceClient = getGlanceClient(cloudSiteId, tenantId);
// list is set to false, otherwise an invalid URL is appended
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java
index 27ff86d7f7..96ed408c80 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/NeutronClientImpl.java
@@ -20,13 +20,14 @@
package org.onap.so.openstack.utils;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import org.onap.so.cloud.authentication.KeystoneAuthHolder;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
import org.onap.so.openstack.exceptions.MsoException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import org.springframework.web.util.UriUtils;
import com.woorea.openstack.base.client.OpenStackRequest;
import com.woorea.openstack.quantum.Quantum;
import com.woorea.openstack.quantum.model.Networks;
@@ -76,7 +77,11 @@ public class NeutronClientImpl extends MsoCommonUtils {
try {
String encodedName = null;
if (name != null) {
- encodedName = UriUtils.encodeQueryParam(name, "UTF-8");
+ try {
+ encodedName = URLEncoder.encode(name, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ logger.error("error encoding query parameter: {}", encodedName);
+ }
}
Quantum neutronClient = getNeutronClient(cloudSiteId, tenantId);
OpenStackRequest<Networks> request = neutronClient.networks().list().queryParam("id", id)