private List<BundleDetails> loadBundleDetails(List<File> unpackedNars) { final List<BundleDetails> narDetails = new ArrayList<>(); for (final File unpackedNar : unpackedNars) { try { final BundleDetails narDetail = getNarDetails(unpackedNar); final BundleCoordinate unpackedNarCoordinate = narDetail.getCoordinate(); // Skip this NAR if there is another NAR with the same group, id, and version final Optional<Bundle> existingBundle = getBundle(unpackedNarCoordinate); if (existingBundle.isPresent()) { final BundleDetails existingBundleDetails = existingBundle.get().getBundleDetails(); final String existingNarWorkingDir = existingBundleDetails.getWorkingDirectory().getCanonicalPath(); final String unpackedNarWorkingDir = narDetail.getWorkingDirectory().getCanonicalPath(); logger.error("Unable to load NAR with coordinates {} and working directory {} " + "because another NAR with the same coordinates already exists at {}", new Object[]{unpackedNarCoordinate, unpackedNarWorkingDir, existingNarWorkingDir}); } else { narDetails.add(narDetail); } } catch (Exception e) { logger.error("Unable to load NAR {} due to {}, skipping...", new Object[]{unpackedNar.getAbsolutePath(), e.getMessage()}); } } return narDetails; }
bundleClassLoader = createNarClassLoader(bundleDetail.getWorkingDirectory(), jettyClassLoader); } else { final Optional<Bundle> dependencyBundle = getBundle(bundleDependencyCoordinate); final Optional<Bundle> matchingDependencyIdBundle = getBundle(coordinate); if (matchingDependencyIdBundle.isPresent()) { final String dependencyCoordinateStr = bundleDependencyCoordinate.getCoordinate();