- try (InputStream inputStream = resource.openStream()) {
- List<String> lines = IOUtils.readLines(inputStream);
- for (String moduleInfoName : lines) {
+ @Override
+ public void close() {
+ if(bundleTracker != null) {
+ bundleTracker.close();
+ }
+ }
+
+ @Override
+ public Collection<ObjectRegistration<YangModuleInfo>> addingBundle(Bundle bundle, BundleEvent event) {
+ URL resource = bundle.getEntry(MODULE_INFO_PROVIDER_PATH_PREFIX + YangModelBindingProvider.class.getName());
+ 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);