+ public static Collection<GraphBundleEx> getGraphs(Bundle bundle) throws IOException {
+ return getTGFiles(bundle).stream()
+ .map(url -> {
+ try {
+ GraphBundleEx result = tryGetOnDemandGraph(bundle, url);
+ return result != null ? result : getCompleteGraph(bundle, url);
+ } catch (IOException e) {
+ if (LOGGER.isWarnEnabled())
+ LOGGER.warn("Could not get graph from bundle url {}", url, e);
+ return null;
+ }
+ })
+ .filter(Objects::nonNull)
+ .collect(Collectors.toList());
+ }
+
+ private static String tgFileId(Bundle bundle, URL url) {
+ String urlString = url.toString();
+ String file = urlString.substring(urlString.lastIndexOf("/") + 1);
+ return bundle.getSymbolicName() + "_" + file;
+ }
+