private IBrandingAdvice getBrandingAdvice() { // there is expected to only be one branding advice for a given configspec so // just return the first one we find. Collection<IBrandingAdvice> advice = info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class); for (Iterator<IBrandingAdvice> i = advice.iterator(); i.hasNext();) return i.next(); return null; }
private IBrandingAdvice getBrandingAdvice() { // there is expected to only be one branding advice for a given configspec so // just return the first one we find. Collection<IBrandingAdvice> advice = info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class); for (Iterator<IBrandingAdvice> i = advice.iterator(); i.hasNext();) return i.next(); return null; }
private IBrandingAdvice getBrandingAdvice() { // there is expected to only be one branding advice for a given configspec so // just return the first one we find. Collection<IBrandingAdvice> advice = info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class); for (Iterator<IBrandingAdvice> i = advice.iterator(); i.hasNext();) return i.next(); return null; }
protected static InstallableUnitDescription[] processAdditionalInstallableUnitsAdvice(IInstallableUnit iu, IPublisherInfo publisherInfo) { Collection<IAdditionalInstallableUnitAdvice> advice = publisherInfo.getAdvice(null, false, iu.getId(), iu.getVersion(), IAdditionalInstallableUnitAdvice.class); if (advice.isEmpty()) return null; List<InstallableUnitDescription> ius = new ArrayList<>(); for (IAdditionalInstallableUnitAdvice entry : advice) { InstallableUnitDescription[] others = entry.getAdditionalInstallableUnitDescriptions(iu); if (others != null) ius.addAll(Arrays.asList(others)); } return ius.toArray(new InstallableUnitDescription[ius.size()]); }
protected static InstallableUnitDescription[] processAdditionalInstallableUnitsAdvice(IInstallableUnit iu, IPublisherInfo publisherInfo) { Collection<IAdditionalInstallableUnitAdvice> advice = publisherInfo.getAdvice(null, false, iu.getId(), iu.getVersion(), IAdditionalInstallableUnitAdvice.class); if (advice.isEmpty()) return null; List<InstallableUnitDescription> ius = new ArrayList<InstallableUnitDescription>(); for (IAdditionalInstallableUnitAdvice entry : advice) { InstallableUnitDescription[] others = entry.getAdditionalInstallableUnitDescriptions(iu); if (others != null) ius.addAll(Arrays.asList(others)); } return ius.toArray(new InstallableUnitDescription[ius.size()]); }
protected static InstallableUnitDescription[] processAdditionalInstallableUnitsAdvice(IInstallableUnit iu, IPublisherInfo publisherInfo) { Collection<IAdditionalInstallableUnitAdvice> advice = publisherInfo.getAdvice(null, false, iu.getId(), iu.getVersion(), IAdditionalInstallableUnitAdvice.class); if (advice.isEmpty()) return null; List<InstallableUnitDescription> ius = new ArrayList<InstallableUnitDescription>(); for (IAdditionalInstallableUnitAdvice entry : advice) { InstallableUnitDescription[] others = entry.getAdditionalInstallableUnitDescriptions(iu); if (others != null) ius.addAll(Arrays.asList(others)); } return ius.toArray(new InstallableUnitDescription[ius.size()]); }
protected static InstallableUnitDescription[] processAdditionalInstallableUnitsAdvice(IInstallableUnit iu, IPublisherInfo publisherInfo) { Collection<IAdditionalInstallableUnitAdvice> advice = publisherInfo.getAdvice(null, false, iu.getId(), iu.getVersion(), IAdditionalInstallableUnitAdvice.class); if (advice.isEmpty()) return null; List<InstallableUnitDescription> ius = new ArrayList<InstallableUnitDescription>(); for (IAdditionalInstallableUnitAdvice entry : advice) { InstallableUnitDescription[] others = entry.getAdditionalInstallableUnitDescriptions(iu); if (others != null) ius.addAll(Arrays.asList(others)); } return ius.toArray(new InstallableUnitDescription[ius.size()]); }
private static boolean isDir(BundleDescription bundle, IPublisherInfo info) { Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class); // if the advice has a shape, use it if (advice != null && !advice.isEmpty()) { // we know there is some advice but if there is more than one, take the first. String shape = advice.iterator().next().getShape(); if (shape != null) return shape.equals(IBundleShapeAdvice.DIR); } // otherwise go with whatever we figured out from the manifest or the shape on disk @SuppressWarnings("unchecked") Map<String, String> manifest = (Map<String, String>) bundle.getUserObject(); String format = manifest.get(BUNDLE_SHAPE); return DIR.equals(format); }
private static boolean isDir(BundleDescription bundle, IPublisherInfo info) { Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class); // if the advice has a shape, use it if (advice != null && !advice.isEmpty()) { // we know there is some advice but if there is more than one, take the first. String shape = advice.iterator().next().getShape(); if (shape != null) return shape.equals(IBundleShapeAdvice.DIR); } // otherwise go with whatever we figured out from the manifest or the shape on disk @SuppressWarnings("unchecked") Map<String, String> manifest = (Map<String, String>) bundle.getUserObject(); String format = manifest.get(BUNDLE_SHAPE); return DIR.equals(format); }
private static boolean isDir(BundleDescription bundle, IPublisherInfo info) { Collection<IBundleShapeAdvice> advice = info.getAdvice(null, true, bundle.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundle.getVersion()), IBundleShapeAdvice.class); // if the advice has a shape, use it if (advice != null && !advice.isEmpty()) { // we know there is some advice but if there is more than one, take the first. String shape = advice.iterator().next().getShape(); if (shape != null) return shape.equals(IBundleShapeAdvice.DIR); } // otherwise go with whatever we figured out from the manifest or the shape on disk @SuppressWarnings("unchecked") Map<String, String> manifest = (Map<String, String>) bundle.getUserObject(); String format = manifest.get(BUNDLE_SHAPE); return DIR.equals(format); }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info, String configSpec) { Collection<ITouchpointAdvice> advice = info.getAdvice(configSpec, false, iu.getId(), iu.getVersion(), ITouchpointAdvice.class); if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); if (advice != null) { for (ITouchpointAdvice entry : advice) { result = entry.getTouchpointData(result); } } iu.addTouchpointData(result); }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
protected static void processLicense(InstallableUnitDescription iu, IPublisherInfo info) { Collection<ILicenseAdvice> advice = info.getAdvice(null, true, iu.getId(), iu.getVersion(), ILicenseAdvice.class); if (advice.size() > 0) { // Only process the first license we find for this IU. ILicenseAdvice entry = advice.iterator().next(); String licenseText = entry.getLicenseText() == null ? "" : entry.getLicenseText(); //$NON-NLS-1$ String licenseUrl = entry.getLicenseURL() == null ? "" : entry.getLicenseURL(); //$NON-NLS-1$ if (licenseText.length() > 0 || licenseUrl.length() > 0) iu.setLicenses(new ILicense[] {MetadataFactory.createLicense(toURIOrNull(licenseUrl), licenseText)}); } }
private IMatchExpression<IInstallableUnit> getFilterAdvice(IVersionedId name) { if (info == null) return null; Collection<IFilterAdvice> filterAdvice = info.getAdvice(CONFIG_ANY, true, name.getId(), name.getVersion(), IFilterAdvice.class); for (IFilterAdvice advice : filterAdvice) { IMatchExpression<IInstallableUnit> result = advice.getFilter(name.getId(), name.getVersion(), false); if (result != null) return result; } return null; }
private IMatchExpression<IInstallableUnit> getFilterAdvice(IVersionedId name) { if (info == null) return null; Collection<IFilterAdvice> filterAdvice = info.getAdvice(CONFIG_ANY, true, name.getId(), name.getVersion(), IFilterAdvice.class); for (IFilterAdvice advice : filterAdvice) { IMatchExpression<IInstallableUnit> result = advice.getFilter(name.getId(), name.getVersion(), false); if (result != null) return result; } return null; }
private IMatchExpression<IInstallableUnit> getFilterAdvice(IVersionedId name) { if (info == null) return null; Collection<IFilterAdvice> filterAdvice = info.getAdvice(CONFIG_ANY, true, name.getId(), name.getVersion(), IFilterAdvice.class); for (IFilterAdvice advice : filterAdvice) { IMatchExpression<IInstallableUnit> result = advice.getFilter(name.getId(), name.getVersion(), false); if (result != null) return result; } return null; }
private IMatchExpression<IInstallableUnit> getFilterAdvice(IVersionedId name) { if (info == null) return null; Collection<IFilterAdvice> filterAdvice = info.getAdvice(CONFIG_ANY, true, name.getId(), name.getVersion(), IFilterAdvice.class); for (IFilterAdvice advice : filterAdvice) { IMatchExpression<IInstallableUnit> result = advice.getFilter(name.getId(), name.getVersion(), false); if (result != null) return result; } return null; }