Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2010-08-26 08:56:02 -0400
committerDJ Houghton2010-08-26 08:56:02 -0400
commit8c91ab7a6145a1176d8f593f209369a559aba8a9 (patch)
treeb3d00dc7b4109806a9f5dd846fab7b340d64d50d /bundles/org.eclipse.equinox.p2.artifact.repository
parentcd254bc15261f58490302ec42031775abc7f593f (diff)
downloadrt.equinox.p2-8c91ab7a6145a1176d8f593f209369a559aba8a9.tar.gz
rt.equinox.p2-8c91ab7a6145a1176d8f593f209369a559aba8a9.tar.xz
rt.equinox.p2-8c91ab7a6145a1176d8f593f209369a559aba8a9.zip
Bug 244628 - [api] [repository] artifact repos do not support bulk remove
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java19
3 files changed, 34 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
index 2cce6bc62..8ce0a38ab 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.artifact.repository;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.repository.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index 928d34b19..c726f294f 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -246,6 +246,13 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
/**
* Composite repositories should be unable to directly modify their child repositories
*/
+ public void removeDescriptors(IArtifactKey[] keys) {
+ throw new UnsupportedOperationException(Messages.exception_unsupportedRemoveFromComposite);
+ }
+
+ /**
+ * Composite repositories should be unable to directly modify their child repositories
+ */
public void removeDescriptor(IArtifactDescriptor descriptor) {
throw new UnsupportedOperationException(Messages.exception_unsupportedRemoveFromComposite);
}
@@ -253,6 +260,13 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
/**
* Composite repositories should be unable to directly modify their child repositories
*/
+ public void removeDescriptors(IArtifactDescriptor[] descriptors) {
+ throw new UnsupportedOperationException(Messages.exception_unsupportedRemoveFromComposite);
+ }
+
+ /**
+ * Composite repositories should be unable to directly modify their child repositories
+ */
public synchronized void removeAll() {
throw new UnsupportedOperationException(Messages.exception_unsupportedRemoveFromComposite);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index 465b29d0f..7e7494c34 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -885,6 +885,25 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
save();
}
+ public synchronized void removeDescriptors(IArtifactDescriptor[] descriptors) {
+ boolean changed = false;
+ for (IArtifactDescriptor descriptor : descriptors)
+ changed |= doRemoveArtifact(descriptor);
+ if (changed)
+ save();
+ }
+
+ public synchronized void removeDescriptors(IArtifactKey[] keys) {
+ boolean changed = false;
+ for (IArtifactKey key : keys) {
+ IArtifactDescriptor[] descriptors = getArtifactDescriptors(key);
+ for (IArtifactDescriptor descriptor : descriptors)
+ changed |= doRemoveArtifact(descriptor);
+ }
+ if (changed)
+ save();
+ }
+
public synchronized void removeDescriptor(IArtifactKey key) {
IArtifactDescriptor[] toRemove = getArtifactDescriptors(key);
boolean changed = false;

Back to the top