Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff McAffer2007-10-05 01:44:34 +0000
committerJeff McAffer2007-10-05 01:44:34 +0000
commita313c31c5d09fb98a35412268e26d086f151a4cd (patch)
tree9be86f58e73424322540d49c4099695ea848d9bf /bundles/org.eclipse.equinox.p2.console
parent28a1eca51ece2c4ffc23537527ec137ed8e7e999 (diff)
downloadrt.equinox.p2-a313c31c5d09fb98a35412268e26d086f151a4cd.tar.gz
rt.equinox.p2-a313c31c5d09fb98a35412268e26d086f151a4cd.tar.xz
rt.equinox.p2-a313c31c5d09fb98a35412268e26d086f151a4cd.zip
Refactor the repo structure: API clarification/simplification and facilitate multiple artifact descriptors per artifact
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.console')
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
index a9d908b01..93e3c6159 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
@@ -8,11 +8,13 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.console;
-import java.net.*;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
+import org.eclipse.equinox.p2.artifact.repository.*;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.Profile;
@@ -231,8 +233,18 @@ public class ProvCommandProvider implements CommandProvider {
interpreter.println("Repository has no artifacts");
return;
}
- for (int i = 0; i < keys.length; i++)
- println(interpreter, keys[i], repo.getArtifact(keys[i]));
+ IFileArtifactRepository fileRepo = (IFileArtifactRepository) repo.getAdapter(IFileArtifactRepository.class);
+ for (int i = 0; i < keys.length; i++) {
+ IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors(keys[i]);
+ for (int j = 0; j < descriptors.length; j++) {
+ IArtifactDescriptor descriptor = descriptors[j];
+ File location = null;
+ if (fileRepo != null)
+ location = fileRepo.getArtifactFile(descriptor);
+ println(interpreter, keys[i], location);
+ }
+
+ }
}
/**
@@ -338,8 +350,8 @@ public class ProvCommandProvider implements CommandProvider {
interpreter.println();
}
- private void println(CommandInterpreter interpreter, IArtifactKey artifactKey, URI artifact) {
- interpreter.print(artifactKey.toString() + ' ' + artifact);
+ private void println(CommandInterpreter interpreter, IArtifactKey artifactKey, File location) {
+ interpreter.print(artifactKey.toString() + ' ' + location);
interpreter.println();
}
} \ No newline at end of file

Back to the top