/** * have we already processed a particular bundle description? */ private boolean alreadyProcessed(BundleDescription bd) { return bundlesProcessed.contains(bd.getName()); }
public static boolean guessUnpack(BundleDescription bundle, String[] classpath) { if (bundle == null) return true; @SuppressWarnings("unchecked") Dictionary<String, String> properties = (Dictionary<String, String>) bundle.getUserObject(); String shape = null; if (properties != null && (shape = properties.get(Constants.ECLIPSE_BUNDLE_SHAPE)) != null) { return shape.equals("dir"); //$NON-NLS-1$ } // launcher fragments are a special case, they have no bundle-classpath and they must //be unpacked if (bundle.getHost() != null && bundle.getName().startsWith(Constants.BUNDLE_EQUINOX_LAUNCHER)) return true; if (new File(bundle.getLocation()).isFile()) return false; if (classpath.length == 0) return false; for (int i = 0; i < classpath.length; i++) { if (classpath[i].equals(".")) //$NON-NLS-1$ return false; } return true; }
public static boolean guessUnpack(BundleDescription bundle, String[] classpath) { if (bundle == null) return true; @SuppressWarnings("unchecked") Dictionary<String, String> properties = (Dictionary<String, String>) bundle.getUserObject(); String shape = null; if (properties != null && (shape = properties.get(Constants.ECLIPSE_BUNDLE_SHAPE)) != null) { return shape.equals("dir"); //$NON-NLS-1$ } // launcher fragments are a special case, they have no bundle-classpath and they must //be unpacked if (bundle.getHost() != null && bundle.getName().startsWith(Constants.BUNDLE_EQUINOX_LAUNCHER)) return true; if (new File(bundle.getLocation()).isFile()) return false; if (classpath.length == 0) return false; for (int i = 0; i < classpath.length; i++) { if (classpath[i].equals(".")) //$NON-NLS-1$ return false; } return true; }
public static boolean guessUnpack(BundleDescription bundle, String[] classpath) { if (bundle == null) return true; @SuppressWarnings("unchecked") Dictionary<String, String> properties = (Dictionary<String, String>) bundle.getUserObject(); String shape = null; if (properties != null && (shape = properties.get(Constants.ECLIPSE_BUNDLE_SHAPE)) != null) { return shape.equals("dir"); //$NON-NLS-1$ } // launcher fragments are a special case, they have no bundle-classpath and they must //be unpacked if (bundle.getHost() != null && bundle.getName().startsWith(Constants.BUNDLE_EQUINOX_LAUNCHER)) return true; if (new File(bundle.getLocation()).isFile()) return false; if (classpath.length == 0) return false; for (int i = 0; i < classpath.length; i++) { if (classpath[i].equals(".")) //$NON-NLS-1$ return false; } return true; }
private File getNestedJar(BundleDescription bundle, String cp) { File bundleLocation = new File(bundle.getLocation()); if (bundleLocation.isDirectory()) { return new File(bundleLocation, cp); } File file = new File(storage, bundle.getName() + "_" + bundle.getVersion() + "/" + cp); try { ZipFile zip = new ZipFile(bundleLocation); try { ZipEntry ze = zip.getEntry(cp); if (ze != null) { InputStream is = zip.getInputStream(ze); FileUtils.copyStreamToFile(new RawInputStreamFacade(is), file); } else { // TODO log } } finally { zip.close(); } } catch (IOException e) { // XXX log return null; } return file; }
for (int i = 0; i < bundles.length; i++) { BundleDescription bundle = bundles[i]; String name = bundle.getName(); if (name == null) name = bundle.getLocation();
@Override public String getName() { if (!isUndo()) { if(getChangeObject() instanceof String) { return MessageFormat.format(PDEUIMessages.UnresolvedImportFixProcessor_0, (getChangeObject().toString())); } return MessageFormat.format(PDEUIMessages.UnresolvedImportFixProcessor_0, ((ExportPackageDescription) getChangeObject()).getExporter().getName()); } return MessageFormat.format(PDEUIMessages.UnresolvedImportFixProcessor_1, ((ExportPackageDescription) getChangeObject()).getExporter().getName()); }
/** * traverse a bundle description and populate the analysis scope accordingly */ private void resolveBundleDescriptionClassPath(P project, BundleDescription bd, Loader loader, boolean includeSource) throws CoreException, IOException { assert bd != null; if (alreadyProcessed(bd)) { return; } bundlesProcessed.add(bd.getName()); // handle the classpath entries for bd ArrayList<IClasspathEntry> l = new ArrayList<>(); ClasspathUtilCore.addLibraries(findModel(bd), l); resolveClasspathEntries(project, l, loader, includeSource, false); // recurse to handle dependencies. put these in the Extension loader for (ImportPackageSpecification b : bd.getImportPackages()) { resolveBundleDescriptionClassPath(project, b.getBundle(), Loader.EXTENSION, includeSource); } for (BundleDescription b : bd.getResolvedRequires()) { resolveBundleDescriptionClassPath(project, b, Loader.EXTENSION, includeSource); } for (BundleDescription b : bd.getFragments()) { resolveBundleDescriptionClassPath(project, b, Loader.EXTENSION, includeSource); } }
String bundleName = model.getBundleDescription().getName(); if (!logOnceProjectLoad.contains(bundleName)) { logOnceProjectLoad.add(bundleName);
BundleDescription host = (BundleDescription)spec.getSupplier(); if (host != null) { ModelEntry hostEntry = (ModelEntry)fEntries.get(host.getName()); if (hostEntry != null) { fState.addBundle(hostEntry.getModel(host), true);
BundleDescription[] hosts = host.getHosts(); for (BundleDescription currentHost : hosts) { IApiComponent apiComponent = component.getBaseline().getApiComponent(currentHost.getName()); if (apiComponent != null) { resolvePackage0(apiComponent, packageName, componentsList);
@Override public String getText(Object element) { if (element instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) element; return model.getInstallLocation(); } else if (element instanceof IPluginExtensionPoint) { IPluginExtensionPoint model = (IPluginExtensionPoint) element; return model.getModel().getInstallLocation(); } else if (element instanceof IPluginExtension) { IPluginExtension model = (IPluginExtension) element; return model.getModel().getInstallLocation(); } else if (element instanceof ExportPackageDescription) { ExportPackageDescription model = (ExportPackageDescription) element; String id = model.getSupplier().getName(); String version = model.getSupplier().getVersion().toString(); IPluginModelBase base = getModel(id, version); return base.getInstallLocation(); } else if (element instanceof IFeatureModel) { IFeatureModel model = (IFeatureModel) element; return model.getInstallLocation(); } return null; }
@Override public Image getImage(Object element) { if (element instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) element; return getImage(model.getInstallLocation()); } else if (element instanceof IPluginExtensionPoint) { IPluginExtensionPoint model = (IPluginExtensionPoint) element; return getImage(model.getModel().getInstallLocation()); } else if (element instanceof IPluginExtension) { IPluginExtension model = (IPluginExtension) element; return getImage(model.getModel().getInstallLocation()); } else if (element instanceof ExportPackageDescription) { ExportPackageDescription model = (ExportPackageDescription) element; String id = model.getSupplier().getName(); String version = model.getSupplier().getVersion().toString(); IPluginModelBase base = getModel(id, version); return getImage(base.getInstallLocation()); } else if (element instanceof IFeatureModel) { IFeatureModel model = (IFeatureModel) element; return getImage(model.getInstallLocation()); } return null; }
BundleDescription host = (BundleDescription) spec.getSupplier(); if (host != null) { ModelEntry hostEntry = entries.get(host.getName()); if (hostEntry != null) { fState.addBundle(hostEntry.getModel(host), true);