public static List<ExportedPackage> getExportedPackages(Bundle bundle) { final List<ExportedPackage> result = new ArrayList<ExportedPackage>(); final BundleManifest manifest = BundleManifestFactory.createBundleManifest(bundle.getHeaders(), new DummyParserLogger()); for (ExportedPackage exportedPackage : manifest.getExportPackage().getExportedPackages()) { result.add(exportedPackage); } return result; }
public static List<ImportedPackage> getImportedPackages(Bundle bundle, Resolution resolution) { final List<ImportedPackage> result = new ArrayList<ImportedPackage>(); final BundleManifest manifest = BundleManifestFactory.createBundleManifest(bundle.getHeaders(), new DummyParserLogger()); for (ImportedPackage importedPackage : manifest.getImportPackage().getImportedPackages()) { if (resolution == null || resolution.equals(importedPackage.getResolution())) { result.add(importedPackage); } } return result; }
public static boolean isWebBundle(Bundle bundle) { return isWebBundle( BundleManifestFactory.createBundleManifest(bundle.getHeaders(), new DummyParserLogger())); }