Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepDescriptor.java89
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java24
3 files changed, 17 insertions, 102 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
index 15375f95d..403670e1a 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStep.java
@@ -11,11 +11,13 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing;
+import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
+
import java.io.IOException;
import java.io.OutputStream;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor;
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
/**
* ProcessingSteps process the data written to them and pass the resultant data on
@@ -39,7 +41,7 @@ public abstract class ProcessingStep extends OutputStream implements IStateful {
* @param descriptor description of the step
* @param context the context in which the step is being used
*/
- public void initialize(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ public void initialize(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
// nothing to do here!
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepDescriptor.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepDescriptor.java
deleted file mode 100644
index f7db92d7e..000000000
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepDescriptor.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2008 compeople AG 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
-* http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* compeople AG (Stefan Liebig) - initial API and implementation
-*******************************************************************************/
-package org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing;
-
-/**
- * The description of a processor step.
- */
-public class ProcessingStepDescriptor {
-
- private final String processorId; //the operation to be applied (e.g: unpack, md5, signature verification, etc.)
- private final String data; //data requested for the processing (eg. expected checksum)
- private final boolean required; //whether the step is optional or not
-
- /**
- * Create a processing step description.
- *
- * @param processorId
- * @param data
- * @param required
- */
- public ProcessingStepDescriptor(String processorId, String data, boolean required) {
- super();
- this.processorId = processorId;
- this.data = data;
- this.required = required;
- }
-
- public String getProcessorId() {
- return processorId;
- }
-
- public String getData() {
- return data;
- }
-
- public boolean isRequired() {
- return required;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((data == null) ? 0 : data.hashCode());
- result = prime * result + ((processorId == null) ? 0 : processorId.hashCode());
- result = prime * result + (required ? 1231 : 1237);
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ProcessingStepDescriptor))
- return false;
- final ProcessingStepDescriptor other = (ProcessingStepDescriptor) obj;
- if (data == null) {
- if (other.data != null)
- return false;
- } else if (!data.equals(other.data))
- return false;
- if (processorId == null) {
- if (other.processorId != null)
- return false;
- } else if (!processorId.equals(other.processorId))
- return false;
- if (required != other.required)
- return false;
- return true;
- }
-
- public String toString() {
- return "Processor: " + processorId + (required ? "(req)" : "(notReq)") + " ,data: " + data; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
- }
-}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
index 508c46486..0387fcd28 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/processing/ProcessingStepHandler.java
@@ -11,13 +11,15 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing;
+import org.eclipse.equinox.p2.repository.artifact.IProcessingStepDescriptor;
+
import java.io.OutputStream;
import java.util.ArrayList;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.repository.Activator;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.ArtifactOutputStream;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor;
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.osgi.util.NLS;
/**
@@ -42,7 +44,7 @@ public class ProcessingStepHandler {
IExtensionPoint point = registry.getExtensionPoint(PROCESSING_STEPS_EXTENSION_ID);
if (point == null)
return false;
- ProcessingStepDescriptor[] steps = descriptor.getProcessingSteps();
+ IProcessingStepDescriptor[] steps = descriptor.getProcessingSteps();
for (int i = 0; i < steps.length; i++) {
if (point.getExtension(steps[i].getProcessorId()) == null)
return false;
@@ -60,11 +62,11 @@ public class ProcessingStepHandler {
public static IStatus getStatus(OutputStream stream, boolean deep) {
if (!deep)
return getStatus(stream);
- ArrayList list = new ArrayList();
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
int severity = collectStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
- IStatus[] result = (IStatus[]) list.toArray(new IStatus[list.size()]);
+ IStatus[] result = list.toArray(new IStatus[list.size()]);
return new MultiStatus(Activator.ID, severity, result, Messages.processing_step_results, null);
}
@@ -74,15 +76,15 @@ public class ProcessingStepHandler {
* @return the requested status
*/
public static IStatus getErrorStatus(OutputStream stream) {
- ArrayList list = new ArrayList();
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
int severity = collectErrorStatus(stream, list);
if (severity == IStatus.OK)
return Status.OK_STATUS;
- IStatus[] result = (IStatus[]) list.toArray(new IStatus[list.size()]);
+ IStatus[] result = list.toArray(new IStatus[list.size()]);
return new MultiStatus(Activator.ID, 0, result, Messages.processing_step_results, null);
}
- private static int collectErrorStatus(OutputStream stream, ArrayList list) {
+ private static int collectErrorStatus(OutputStream stream, ArrayList<IStatus> list) {
IStatus status = getStatus(stream);
if (!status.isOK())
list.add(status);
@@ -105,7 +107,7 @@ public class ProcessingStepHandler {
return Status.OK_STATUS;
}
- private static int collectStatus(OutputStream stream, ArrayList list) {
+ private static int collectStatus(OutputStream stream, ArrayList<IStatus> list) {
IStatus status = getStatus(stream);
list.add(status);
OutputStream destination = getDestination(stream);
@@ -125,14 +127,14 @@ public class ProcessingStepHandler {
return null;
}
- public ProcessingStep[] create(ProcessingStepDescriptor[] descriptors, IArtifactDescriptor context) {
+ public ProcessingStep[] create(IProcessingStepDescriptor[] descriptors, IArtifactDescriptor context) {
ProcessingStep[] result = new ProcessingStep[descriptors.length];
for (int i = 0; i < descriptors.length; i++)
result[i] = create(descriptors[i], context);
return result;
}
- public ProcessingStep create(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
+ public ProcessingStep create(IProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
IExtensionRegistry registry = RegistryFactory.getRegistry();
IExtension extension = registry.getExtension(PROCESSING_STEPS_EXTENSION_ID, descriptor.getProcessorId());
Exception error;
@@ -155,7 +157,7 @@ public class ProcessingStepHandler {
return result;
}
- public OutputStream createAndLink(ProcessingStepDescriptor[] descriptors, IArtifactDescriptor context, OutputStream output, IProgressMonitor monitor) {
+ public OutputStream createAndLink(IProcessingStepDescriptor[] descriptors, IArtifactDescriptor context, OutputStream output, IProgressMonitor monitor) {
if (descriptors == null)
return output;
ProcessingStep[] steps = create(descriptors, context);

Back to the top