Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-03-08 17:17:36 -0500
committerAndrew Niefer2010-03-08 17:17:36 -0500
commitf161eb55f9d01ffdcd4fda1b21a800a87f351a99 (patch)
treeb1f6e49c933f57448b57cad8f405378b5487c4c9 /bundles/org.eclipse.equinox.p2.repository
parentd901bbc39b89d539c6d807ebc59c41e5ef8eb827 (diff)
downloadrt.equinox.p2-f161eb55f9d01ffdcd4fda1b21a800a87f351a99.tar.gz
rt.equinox.p2-f161eb55f9d01ffdcd4fda1b21a800a87f351a99.tar.xz
rt.equinox.p2-f161eb55f9d01ffdcd4fda1b21a800a87f351a99.zip
bug 305069 - IArtifactKey api
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java6
2 files changed, 18 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java
index 610490121..ce2b41a64 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactRepository.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository;
@@ -38,13 +39,22 @@ public interface IArtifactRepository extends IRepository<IArtifactKey> {
public static int CODE_RETRY = 13;
/**
- * Create an instance of IArtifactDescriptor based on the given key
- * @param key
+ * Create an instance of {@link IArtifactDescriptor} based on the given key
+ * @param key {@link IArtifactKey}
* @return a new instanceof of IArtifactDescriptor
*/
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key);
/**
+ * Create an instance of {@link IArtifactKey}
+ * @param classifier
+ * @param id
+ * @param version
+ * @return a new IArtifactKey
+ */
+ public IArtifactKey createArtifactKey(String classifier, String id, Version version);
+
+ /**
* Add the given descriptor to the set of descriptors in this repository. This is
* a relatively low-level operation that should be used only when the actual related
* content is in this repository and the given descriptor accurately describes
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
index 03733dde0..93f4173a5 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/AbstractArtifactRepository.java
@@ -14,10 +14,12 @@ import java.io.OutputStream;
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.repository.Activator;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.spi.AbstractRepository;
@@ -88,6 +90,10 @@ public abstract class AbstractArtifactRepository extends AbstractRepository<IArt
return new ArtifactDescriptor(key);
}
+ public IArtifactKey createArtifactKey(String classifier, String id, Version version) {
+ return new ArtifactKey(classifier, id, version);
+ }
+
public IStatus executeBatch(Runnable runnable) {
try {
runnable.run();

Back to the top