public ArtifactKey(IArtifactKey artifactKey) { this.classifier = artifactKey.getClassifier(); this.id = artifactKey.getId(); this.version = artifactKey.getVersion(); }
public String getLabel(Object o) { return key.getId() + " [" + key.getClassifier() + "]"; //$NON-NLS-1$//$NON-NLS-2$ }
/** * The query will match descriptors whose <code>id</code> and <code>versionRange</code> * match the supplied key * @param key the artifact key to match. Cannot be <code>null</code>. */ public ArtifactDescriptorQuery(IArtifactKey key) { super(IArtifactDescriptor.class, createExpression(key.getId(), new VersionRange(key.getVersion(), true, key.getVersion(), true), null, null)); }
public KeyIndex(Collection<IArtifactKey> artifactKeys) { artifactMap = new HashMap<String, Object>(artifactKeys.size()); for (IArtifactKey ak : artifactKeys) { Object prev = artifactMap.put(ak.getId(), ak); if (prev != null) { if (prev instanceof IArtifactKey) artifactMap.put(ak.getId(), new IArtifactKey[] {(IArtifactKey) prev, ak}); else { IArtifactKey[] prevArr = (IArtifactKey[]) prev; IArtifactKey[] nxtArr = new IArtifactKey[prevArr.length + 1]; System.arraycopy(prevArr, 0, nxtArr, 0, prevArr.length); nxtArr[prevArr.length] = ak; artifactMap.put(ak.getId(), nxtArr); } } } }
return key.getVersion().toString();
@Override public OutputStream getOutputStream(IArtifactDescriptor descriptor) throws ProvisionException { IArtifactKey artifactKey = descriptor.getArtifactKey(); if (artifactKey != null && PublisherHelper.BINARY_ARTIFACT_CLASSIFIER.equals(artifactKey.getClassifier())) { try { return createRootfileOutputStream(artifactKey); } catch (IOException e) { throw new ProvisionException(e.getMessage(), e); } } return super.getOutputStream(descriptor); }
destination.close(); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), e); return status; MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, new IStatus[0], NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), null);
/** * The query will match descriptors whose <code>id</code> and <code>versionRange</code> * match the supplied key * @param key the artifact key to match. Cannot be <code>null</code>. */ public ArtifactDescriptorQuery(IArtifactKey key) { super(IArtifactDescriptor.class, createExpression(key.getId(), new VersionRange(key.getVersion(), true, key.getVersion(), true), null, null)); }
public KeyIndex(Collection<IArtifactKey> artifactKeys) { artifactMap = new HashMap<String, Object>(artifactKeys.size()); for (IArtifactKey ak : artifactKeys) { Object prev = artifactMap.put(ak.getId(), ak); if (prev != null) { if (prev instanceof IArtifactKey) artifactMap.put(ak.getId(), new IArtifactKey[] {(IArtifactKey) prev, ak}); else { IArtifactKey[] prevArr = (IArtifactKey[]) prev; IArtifactKey[] nxtArr = new IArtifactKey[prevArr.length + 1]; System.arraycopy(prevArr, 0, nxtArr, 0, prevArr.length); nxtArr[prevArr.length] = ak; artifactMap.put(ak.getId(), nxtArr); } } } }
return key.getId() + " [" + key.getClassifier() + "]"; //$NON-NLS-1$//$NON-NLS-2$
private void addArtifactFile(DefaultP2ResolutionResult result, IInstallableUnit iu, IArtifactKey key, File artifactLocation) { String id = iu.getId(); String version = iu.getVersion().toString(); String mavenClassifier = null; if (PublisherHelper.OSGI_BUNDLE_CLASSIFIER.equals(key.getClassifier())) { result.addArtifact(ArtifactType.TYPE_ECLIPSE_PLUGIN, id, version, artifactLocation, mavenClassifier, iu); } else if (PublisherHelper.ECLIPSE_FEATURE_CLASSIFIER.equals(key.getClassifier())) { String featureId = getFeatureId(iu); if (featureId != null) { result.addArtifact(ArtifactType.TYPE_ECLIPSE_FEATURE, featureId, version, artifactLocation, mavenClassifier, iu); } } // ignore other/unknown artifacts, like binary blobs for now. // throw new IllegalArgumentException(); }
destination.close(); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), e); return status; MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, new IStatus[0], NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), null);
public boolean equals(Object obj) { if (!(obj instanceof IArtifactKey)) return false; IArtifactKey ak = (IArtifactKey) obj; return ak.getId().equals(id) && ak.getVersion().equals(getVersion()) && ak.getClassifier().equals(classifier); }
return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_FEATURE_ID, ID)); else if (ActionConstants.PARM_DEFAULT_VALUE.equals(featureId)) { featureId = artifactKey.getId(); return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_FEATURE_VERSION, ID)); else if (ActionConstants.PARM_DEFAULT_VALUE.equals(featureVersion)) { featureVersion = artifactKey.getVersion().toString();
public KeyIndex(Collection<IArtifactKey> artifactKeys) { artifactMap = new HashMap<>(artifactKeys.size()); for (IArtifactKey ak : artifactKeys) { Object prev = artifactMap.put(ak.getId(), ak); if (prev != null) { if (prev instanceof IArtifactKey) artifactMap.put(ak.getId(), new IArtifactKey[] {(IArtifactKey) prev, ak}); else { IArtifactKey[] prevArr = (IArtifactKey[]) prev; IArtifactKey[] nxtArr = new IArtifactKey[prevArr.length + 1]; System.arraycopy(prevArr, 0, nxtArr, 0, prevArr.length); nxtArr[prevArr.length] = ak; artifactMap.put(ak.getId(), nxtArr); } } } }
destination.close(); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), e); return status; MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, new IStatus[0], NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), null);
/** * @see #flatButPackedEnabled(IArtifactDescriptor) */ private URI getLocationForPackedButFlatArtifacts(IArtifactDescriptor descriptor) { IArtifactKey key = descriptor.getArtifactKey(); return mapper.map(getLocation(), key.getClassifier(), key.getId(), key.getVersion().toString(), descriptor.getProperty(IArtifactDescriptor.FORMAT)); }
manipulator.removeBundle(bundleFile, artifactKey.getId(), artifactKey.getVersion()); } catch (IOException e) { return Util.createError(NLS.bind(Messages.cannot_configure_source_bundle, artifactKey));
public KeyIndex(Collection<IArtifactKey> artifactKeys) { artifactMap = new HashMap<String, Object>(artifactKeys.size()); for (IArtifactKey ak : artifactKeys) { Object prev = artifactMap.put(ak.getId(), ak); if (prev != null) { if (prev instanceof IArtifactKey) artifactMap.put(ak.getId(), new IArtifactKey[] {(IArtifactKey) prev, ak}); else { IArtifactKey[] prevArr = (IArtifactKey[]) prev; IArtifactKey[] nxtArr = new IArtifactKey[prevArr.length + 1]; System.arraycopy(prevArr, 0, nxtArr, 0, prevArr.length); nxtArr[prevArr.length] = ak; artifactMap.put(ak.getId(), nxtArr); } } } }
destination.close(); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), e); return status; MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, new IStatus[0], NLS.bind(Messages.sar_reportStatus, descriptor.getArtifactKey().toExternalForm()), null);