public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) { properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); if (publisherInfo.getContextMetadataRepository() != null) ius.addAll(getIUs(publisherInfo.getContextMetadataRepository().query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet(), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER)); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); if (publisherInfo.getContextMetadataRepository() != null) ius.addAll(getIUs(publisherInfo.getContextMetadataRepository().query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet(), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER)); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }