diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2020-07-16 05:55:07 +0200 |
---|---|---|
committer | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2020-07-16 05:55:21 +0200 |
commit | 7dbe38ba0522b346a0fcd9851e797f0fd71ecd5e (patch) | |
tree | cc19db7e0637c8e392d40cdf3a53bb5e5f3e0d30 /sdnr/wt/odlux/core/model/src/main/java/org | |
parent | 25b3759a0907d06e0d8e391f751c6fcf067087f5 (diff) |
switch to rfc8040 restconf
change rest interface and some small code cleanups
Issue-ID: CCSDK-2572
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Change-Id: I3475bd2574b32950c4bf84fbd1c2a9dac9af208a
Diffstat (limited to 'sdnr/wt/odlux/core/model/src/main/java/org')
4 files changed, 18 insertions, 19 deletions
diff --git a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/ClassLoaderUtilExt.java b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/ClassLoaderUtilExt.java index f6d0b55bf..a4a0e76c3 100644 --- a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/ClassLoaderUtilExt.java +++ b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/ClassLoaderUtilExt.java @@ -37,7 +37,7 @@ public class ClassLoaderUtilExt { try { urls = getResources(resourceName, callingClass, true); } catch (IOException e) { - LOG.debug("No resource {}",resourceName); + LOG.debug("No resource {}", resourceName); } if (urls != null) { while (urls.hasNext()) { @@ -50,11 +50,9 @@ public class ClassLoaderUtilExt { if (url == null) { LOG.debug("res currently not found. try to find with bundle"); Bundle b = FrameworkUtil.getBundle(callingClass); - if(b!=null) - { + if (b != null) { url = b.getEntry(resourceName); - } - else { + } else { ClassLoader loader = Thread.currentThread().getContextClassLoader(); url = loader.getResource(resourceName); } diff --git a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundle.java b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundle.java index e1e300a0d..ab69d63c8 100644 --- a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundle.java +++ b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundle.java @@ -25,8 +25,8 @@ import java.io.InputStreamReader; import java.net.URL; /** - * At startup of each karaf bundle, each UI module creates an instance of this class via blueprint. - * Initialize method gets called at loading of bundle. + * At startup of each karaf bundle, each UI module creates an instance of this class via blueprint. Initialize method + * gets called at loading of bundle. */ public class OdluxBundle { @@ -103,12 +103,12 @@ public class OdluxBundle { public String getResourceFileContent(String filename) { return this.loadFileContent(this.getResource(filename)); } - + protected URL getResource(String filename) { return ClassLoaderUtilExt.getResource(filename, this.getClass()); } - protected String loadFileContent(final URL url ) { + protected String loadFileContent(final URL url) { if (url == null) return null; LOG.debug("try to load res " + url.toString()); @@ -124,15 +124,14 @@ public class OdluxBundle { } catch (IOException e) { LOG.warn("could not load resfile " + url.toString() + ": " + e.getMessage()); return null; - } - finally { - if(in!=null) { - try { - in.close(); - } catch (IOException e) { - - } - } + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + + } + } } return sb.toString(); diff --git a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleLoader.java b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleLoader.java index 455c83296..870011e85 100644 --- a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleLoader.java +++ b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleLoader.java @@ -25,6 +25,6 @@ public interface OdluxBundleLoader { public int getNumberOfBundles(); - public String getResourceContent(String fn, OdluxBundleResourceAccess indexBundle); + public String getResourceContent(String fn, OdluxBundleResourceAccess indexBundle); } diff --git a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleResourceAccess.java b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleResourceAccess.java index f9a842556..1abed468b 100644 --- a/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleResourceAccess.java +++ b/sdnr/wt/odlux/core/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/model/bundles/OdluxBundleResourceAccess.java @@ -22,7 +22,9 @@ import java.util.List; public interface OdluxBundleResourceAccess { boolean hasResource(String fn); + String getResourceFileContent(String fn, List<String> bundleNames); + String getBundleName(); } |