示例#1
0
 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;
 }
示例#2
0
 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;
 }
示例#3
0
 public static ImportedPackage getImportedPackage(BundleManifest manifest, String packageName) {
   ImportedPackage result = null;
   for (ImportedPackage importedPackage : manifest.getImportPackage().getImportedPackages()) {
     if (importedPackage.getPackageName().equals(packageName)) {
       result = importedPackage;
       break;
     }
   }
   return result;
 }
示例#4
0
 public static boolean isWebBundle(BundleManifest manifest) {
   return manifest.getHeader("Web-ContextPath") != null;
 }