- try (InputStream inputStream = resource.openStream()) {
- List<String> lines = IOUtils.readLines(inputStream);
- for (String moduleInfoName : lines) {
+ @Override
+ public void close() {
+ if (bundleTracker != null) {
+ bundleTracker.close();
+ bundleTracker = null;
+ }
+ }
+
+ @Override
+ public Collection<ObjectRegistration<YangModuleInfo>> addingBundle(final Bundle bundle, final BundleEvent event) {
+ URL resource = bundle.getEntry(YANG_MODULE_INFO_SERVICE_PATH);
+ LOG.debug("Got addingBundle({}) with YangModelBindingProvider resource {}", bundle, resource);
+ if (resource == null) {
+ return Collections.emptyList();
+ }
+ List<ObjectRegistration<YangModuleInfo>> registrations = new LinkedList<>();
+
+ try {
+ for (String moduleInfoName : Resources.readLines(resource, StandardCharsets.UTF_8)) {
+ LOG.trace("Retrieve ModuleInfo({}, {})", moduleInfoName, bundle);