Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-02-26 11:05:05 -0500
committerAndrew Niefer2010-02-26 11:05:05 -0500
commit1d3249ec1e35262ad92a8081c59d4d3e5b6d3cf9 (patch)
tree355f3f27c73b26254fd294987971139818aa5235 /bundles/org.eclipse.equinox.p2.artifact.repository
parent3328c174483daac28c1be073b1591ebdd8d974f7 (diff)
downloadrt.equinox.p2-1d3249ec1e35262ad92a8081c59d4d3e5b6d3cf9.tar.gz
rt.equinox.p2-1d3249ec1e35262ad92a8081c59d4d3e5b6d3cf9.tar.xz
rt.equinox.p2-1d3249ec1e35262ad92a8081c59d4d3e5b6d3cf9.zip
bug 301305 - missing methods on IArtifactRequest
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRequest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/RawMirrorRequest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java10
5 files changed, 13 insertions, 13 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRequest.java
index 6fe6fc267..8f596e5e6 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRequest.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -54,10 +54,11 @@ public abstract class ArtifactRequest implements IArtifactRequest {
/**
* Performs the artifact request, and sets the result status.
*
+ * @param sourceRepository the repository to download the artifact from
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting is not desired
*/
- abstract public void perform(IProgressMonitor monitor);
+ abstract public void perform(IArtifactRepository sourceRepository, IProgressMonitor monitor);
/**
* Sets the result of an invocation of {@link #perform(IProgressMonitor)}.
@@ -70,7 +71,7 @@ public abstract class ArtifactRequest implements IArtifactRequest {
result = value;
}
- public void setSourceRepository(IArtifactRepository value) {
+ protected void setSourceRepository(IArtifactRepository value) {
source = value;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
index 439fb4a5f..6f022e656 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/MirrorRequest.java
@@ -58,8 +58,9 @@ public class MirrorRequest extends ArtifactRequest {
}
}
- public void perform(IProgressMonitor monitor) {
+ public void perform(IArtifactRepository sourceRepository, IProgressMonitor monitor) {
monitor.subTask(NLS.bind(Messages.downloading, getArtifactKey().getId()));
+ setSourceRepository(sourceRepository);
// Do we already have the artifact in the target?
if (target.contains(getArtifactKey())) {
setResult(new Status(IStatus.OK, Activator.ID, NLS.bind(Messages.available_already_in, getArtifactKey())));
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/RawMirrorRequest.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/RawMirrorRequest.java
index 3c2432543..740775e83 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/RawMirrorRequest.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/RawMirrorRequest.java
@@ -29,8 +29,9 @@ public class RawMirrorRequest extends MirrorRequest {
this.targetDescriptor = targetDescriptor;
}
- public void perform(IProgressMonitor monitor) {
+ public void perform(IArtifactRepository sourceRepository, IProgressMonitor monitor) {
monitor.subTask(NLS.bind(Messages.downloading, getArtifactKey().getId()));
+ setSourceRepository(sourceRepository);
// Do we already have the descriptor in the target?
if (target.contains(targetDescriptor)) {
setResult(new Status(IStatus.INFO, Activator.ID, NLS.bind(Messages.mirror_alreadyExists, targetDescriptor, target)));
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
index 69aee86ef..20373a7b6 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/DownloadJob.java
@@ -12,7 +12,6 @@ package org.eclipse.equinox.internal.p2.artifact.repository.simple;
import java.util.LinkedList;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRequest;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
public class DownloadJob extends Job {
@@ -61,7 +60,7 @@ public class DownloadJob extends Job {
SubProgressMonitor subMonitor = new SubProgressMonitor(masterMonitor, 1);
subMonitor.beginTask("", 1); //$NON-NLS-1$
try {
- IStatus status = repository.getArtifact((ArtifactRequest) request, subMonitor);
+ IStatus status = repository.getArtifact(request, subMonitor);
if (!status.isOK()) {
synchronized (overallStatus) {
overallStatus.add(status);
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 6088c3873..d21d87c89 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
@@ -16,7 +16,6 @@ import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
-import java.util.Map.Entry;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
import org.eclipse.core.runtime.*;
@@ -337,7 +336,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
internal.setRepositoryProperty(ARTIFACT_FOLDER, Boolean.TRUE.toString());
if (descriptor instanceof SimpleArtifactDescriptor) {
Map<String, String> repoProperties = ((SimpleArtifactDescriptor) descriptor).getRepositoryProperties();
- for (Entry<String, String> entry : repoProperties.entrySet()) {
+ for (Map.Entry<String, String> entry : repoProperties.entrySet()) {
internal.setRepositoryProperty(entry.getKey(), entry.getValue());
}
}
@@ -548,9 +547,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return super.getAdapter(adapter);
}
- IStatus getArtifact(ArtifactRequest request, IProgressMonitor monitor) {
- request.setSourceRepository(this);
- request.perform(monitor);
+ IStatus getArtifact(IArtifactRequest request, IProgressMonitor monitor) {
+ request.perform(this, monitor);
return request.getResult();
}
@@ -601,7 +599,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
for (int i = 0; i < requests.length; i++) {
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
- IStatus result = getArtifact((ArtifactRequest) requests[i], subMonitor.newChild(1));
+ IStatus result = getArtifact(requests[i], subMonitor.newChild(1));
if (!result.isOK())
overallStatus.add(result);
}

Back to the top