public Collection<BundleFile> extractNestedJars(BundleFile bf, File nestedBundlesDir) throws IOException { Collection<BundleFile> bundles = null; if (scanForNestedJARs) { bundles = bf.findNestedBundles(nestedBundlesDir); } else { // use manifest to find nested jars bundles = bf.getNestedBundles(nestedBundlesDir); } if (bundles != null && bundles.isEmpty()) { bundles = null; } return bundles; }
public void visitNestedBundles(BundleFile bundleFile) throws IOException { if (bundleFile instanceof NestedJarBundleFile) { return; // do not allows more than one level of nesting } if (extractNestedJARs) { Collection<BundleFile> bundles; if (scanForNestedJARs) { bundles = bundleFile.findNestedBundles(tmpDir); } else { // use manifest to find nested jars bundles = bundleFile.getNestedBundles(tmpDir); } if (bundles == null || bundles.isEmpty()) { return; } for (BundleFile bundle : bundles) { if (bundle.getSymbolicName() != null) { visitBundle(bundle); } else { visitJar(bundle); } } } } }