/** * Creates a new versioned id with the given id and version. * * @param id The identifier * @param version The version * @throws IllegalArgumentException If <code>version</code> is improperly * formatted. */ public VersionedId(String id, String version) { this.id = id; this.version = Version.parseVersion(version); }
private void checkAdviceVersion(String adviceVersion) { Version version = Version.parseVersion(adviceVersion); if (!VERSION_TOLERANCE.isIncluded(version)) throw new IllegalStateException("bad version: " + version + ". Expected range was " + VERSION_TOLERANCE); //$NON-NLS-1$ //$NON-NLS-2$ }
public static Version parseAsOSGiVersion(String version) throws IllegalArtifactReferenceException { try { return Version.parseVersion(version); } catch (IllegalArgumentException e) { throw new IllegalArtifactReferenceException("The string \"" + version + "\" is not a valid OSGi version"); } }
public FeatureEntry(String id, String version, boolean isPlugin) { this.id = id; this.versionOrRange = Version.parseVersion(version).toString(); this.isPlugin = isPlugin; }
public FeatureEntry(String id, String version, boolean isPlugin) { this.id = id; this.versionOrRange = Version.parseVersion(version).toString(); this.isPlugin = isPlugin; }
public FeatureEntry(String id, String version, boolean isPlugin) { this.id = id; this.versionOrRange = Version.parseVersion(version).toString(); this.isPlugin = isPlugin; }
private void checkAdviceVersion(String adviceVersion) { Version version = Version.parseVersion(adviceVersion); if (!VERSION_TOLERANCE.isIncluded(version)) throw new IllegalStateException("bad version: " + version + ". Expected range was " + VERSION_TOLERANCE); //$NON-NLS-1$ //$NON-NLS-2$ }
private void checkAdviceVersion(String adviceVersion) { Version version = Version.parseVersion(adviceVersion); if (!VERSION_TOLERANCE.isIncluded(version)) throw new IllegalStateException("bad version: " + version + ". Expected range was " + VERSION_TOLERANCE); //$NON-NLS-1$ //$NON-NLS-2$ }
private void checkAdviceVersion(String adviceVersion) { Version version = Version.parseVersion(adviceVersion); if (!VERSION_TOLERANCE.isIncluded(version)) throw new IllegalStateException("bad version: " + version + ". Expected range was " + VERSION_TOLERANCE); //$NON-NLS-1$ //$NON-NLS-2$ }
private static Version parseVersion(String version) { if (version == null) { return null; } try { return Version.parseVersion(version); } catch (IllegalArgumentException e) { throw new TargetPlatformFilterSyntaxException("Failed to parse version: " + version, e); } }
/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
/** * Create advice for a p2.inf file co-located with the product file, if any. */ private void createAdviceFileAdvice() { File productFileLocation = product.getLocation(); if (productFileLocation == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(product.getId(), Version.parseVersion(product.getVersion()), new Path(productFileLocation.getParent()), new Path("p2.inf")); //$NON-NLS-1$ if (advice.containsAdvice()) info.addAdvice(advice); }
private Version parseVersion(Unit unitReference) throws TargetDefinitionSyntaxException { try { return Version.parseVersion(unitReference.getVersion()); } catch (IllegalArgumentException e) { throw new TargetDefinitionSyntaxException(NLS.bind("Cannot parse version \"{0}\" of unit \"{1}\"", unitReference.getVersion(), unitReference.getId()), e); } } }
@Override protected void addPublisherAdvice(IPublisherInfo publisherInfo) { // see org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction.createAdviceFileAdvice(Feature, IPublisherInfo) IPath location = new Path(feature.getLocation()); Version version = Version.parseVersion(feature.getVersion()); String groupId = getId(); AdviceFileAdvice advice = new AdviceFileAdvice(groupId, version, location, new Path("p2.inf")); if (advice.containsAdvice()) { publisherInfo.addAdvice(advice); } }
private void createProductAdvice() { id = product.getId(); version = Version.parseVersion(product.getVersion()); name = product.getProductName(); if (name == null || name.length() == 0) // If the name is not defined, use the ID name = product.getId(); String[] configSpecs = info.getConfigurations(); for (int i = 0; i < configSpecs.length; i++) info.addAdvice(new ProductFileAdvice(product, configSpecs[i])); }
private void createProductAdvice() { id = product.getId(); version = Version.parseVersion(product.getVersion()); name = product.getProductName(); if (name == null || name.length() == 0) // If the name is not defined, use the ID name = product.getId(); String[] configSpecs = info.getConfigurations(); for (int i = 0; i < configSpecs.length; i++) info.addAdvice(new ProductFileAdvice(product, configSpecs[i])); }
@Override protected Feature[] getFeatures(File[] locations) { Feature feature = new FeatureParser().parse(featureRoot); if (feature != null) { feature.setLocation(locations[0].getAbsolutePath()); rootAdvice.setFeatureId(feature.getId()); rootAdvice.setFeatureVersion(Version.parseVersion(feature.getVersion())); return new Feature[] {feature}; } return new Feature[0]; }
@Override protected Feature[] getFeatures(File[] locations) { Feature feature = new FeatureParser().parse(featureRoot); if (feature != null) { feature.setLocation(locations[0].getAbsolutePath()); rootAdvice.setFeatureId(feature.getId()); rootAdvice.setFeatureVersion(Version.parseVersion(feature.getVersion())); return new Feature[] {feature}; } return new Feature[0]; }
private void createProductAdvice() { id = product.getId(); version = Version.parseVersion(product.getVersion()); name = product.getProductName(); if (name == null || name.length() == 0) // If the name is not defined, use the ID name = product.getId(); String[] configSpecs = info.getConfigurations(); for (int i = 0; i < configSpecs.length; i++) info.addAdvice(new ProductFileAdvice(product, configSpecs[i])); }