commit | 2c3ff591479f987a5eb2aacd7d54e7c39c976434 | [log] [tgz] |
---|---|---|
author | Amit Ghosh <aghosh@radisys.com> | Mon Nov 13 07:04:41 2017 +0000 |
committer | Amit Ghosh <aghosh@radisys.com> | Thu Nov 16 09:48:01 2017 +0000 |
tree | 2dc376f51e794fe6bd7efa2e99e4475f457ea956 | |
parent | 6f55079f5add3cd15d0512a9c996bfcb971e8cf6 [diff] [blame] |
VOL-543: Provision for specifying urls where subscriber id is not at the end Change-Id: I3aa7030ebe34f6ecaa6a761db523e0c6df7a3eb7
diff --git a/app/src/main/java/org/opencord/sadis/impl/SubscriberAndDeviceInformationAdapter.java b/app/src/main/java/org/opencord/sadis/impl/SubscriberAndDeviceInformationAdapter.java index 5085ae8..5026e66 100644 --- a/app/src/main/java/org/opencord/sadis/impl/SubscriberAndDeviceInformationAdapter.java +++ b/app/src/main/java/org/opencord/sadis/impl/SubscriberAndDeviceInformationAdapter.java
@@ -192,14 +192,9 @@ } } else { // Augment URL with query parameters - StringBuilder buf = new StringBuilder(this.url); - if (buf.charAt(buf.length() - 1) != '/') { - buf.append('/'); - } + String urlWithSubId = this.url.replaceAll("%s", id); - buf.append(id); - - try (InputStream io = new URL(buf.toString()).openStream()) { + try (InputStream io = new URL(urlWithSubId).openStream()) { info = mapper.readValue(io, SubscriberAndDeviceInformation.class); local.put(id, info); return info;