Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2009-12-10 20:01:32 +0000
committerJohn Arthorne2009-12-10 20:01:32 +0000
commitf7ec9992a86d1dfc18b4d40f92827e361c8d0da8 (patch)
treece67e68267a66c5324ebb0d66d23ef61af3372da
parent9d6e3974190599784bcb41f3c76fa704fa1a2d15 (diff)
downloadrt.equinox.p2-f7ec9992a86d1dfc18b4d40f92827e361c8d0da8.tar.gz
rt.equinox.p2-f7ec9992a86d1dfc18b4d40f92827e361c8d0da8.tar.xz
rt.equinox.p2-f7ec9992a86d1dfc18b4d40f92827e361c8d0da8.zip
artifact descriptor API cleanup
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java47
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ProcessingStepDescriptor.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java5
14 files changed, 90 insertions, 27 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
index d62ddb221..8fde98f20 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
@@ -25,7 +25,6 @@ import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.osgi.util.NLS;
public class Optimizer {
- private static final String PACKED_FORMAT = "packed"; //$NON-NLS-1$
private IArtifactRepository repository;
public Optimizer(IArtifactRepository repository) {
@@ -64,7 +63,7 @@ public class Optimizer {
ArtifactDescriptor newDescriptor = new ArtifactDescriptor(descriptor);
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
newDescriptor.setProcessingSteps(steps);
- newDescriptor.setProperty(IArtifactDescriptor.FORMAT, PACKED_FORMAT);
+ newDescriptor.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
OutputStream repositoryStream = null;
try {
repositoryStream = repository.getOutputStream(newDescriptor);
@@ -101,7 +100,7 @@ public class Optimizer {
}
private boolean isOptimized(IArtifactDescriptor descriptor) {
- return PACKED_FORMAT.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
+ return IArtifactDescriptor.FORMAT_PACKED.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
}
}
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 cc9758aec..c66762e12 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
@@ -209,7 +209,6 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
private transient BlobStore blobStore;
transient private Mapper mapper = new Mapper();
- static final private String PACKED_FORMAT = "packed"; //$NON-NLS-1$
static final private String PUBLISH_PACK_FILES_AS_SIBLINGS = "publishPackFilesAsSiblings"; //$NON-NLS-1$
private static final int DEFAULT_MAX_THREADS = 4;
@@ -643,7 +642,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
* this arrangement "flat but packed".
*/
private boolean flatButPackedEnabled(IArtifactDescriptor descriptor) {
- return Boolean.TRUE.toString().equals(getProperties().get(PUBLISH_PACK_FILES_AS_SIBLINGS)) && PACKED_FORMAT.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
+ return Boolean.TRUE.toString().equals(getProperties().get(PUBLISH_PACK_FILES_AS_SIBLINGS)) && IArtifactDescriptor.FORMAT_PACKED.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
}
/**
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java
index 458d92d1e..0991f7614 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/MetadataGeneratorHelper.java
@@ -182,7 +182,6 @@ public class MetadataGeneratorHelper {
* @deprecated moved to AbstractPublishingAction
*/
public static IArtifactDescriptor createPack200ArtifactDescriptor(IArtifactKey key, File pathOnDisk, String installSize) {
- final String PACKED_FORMAT = "packed"; //$NON-NLS-1$
//TODO this size calculation is bogus
ArtifactDescriptor result = new ArtifactDescriptor(key);
if (pathOnDisk != null) {
@@ -192,7 +191,7 @@ public class MetadataGeneratorHelper {
}
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
result.setProcessingSteps(steps);
- result.setProperty(IArtifactDescriptor.FORMAT, PACKED_FORMAT);
+ result.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
return result;
}
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
index 2b484433a..790527264 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
@@ -198,7 +198,6 @@ public abstract class AbstractPublisherAction implements IPublisherAction {
}
protected IArtifactDescriptor createPack200ArtifactDescriptor(IArtifactKey key, File pathOnDisk, String installSize) {
- final String PACKED_FORMAT = "packed"; //$NON-NLS-1$
//TODO this size calculation is bogus
ArtifactDescriptor result = new ArtifactDescriptor(key);
if (pathOnDisk != null) {
@@ -208,7 +207,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction {
}
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
result.setProcessingSteps(steps);
- result.setProperty(IArtifactDescriptor.FORMAT, PACKED_FORMAT);
+ result.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
return result;
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
index e4f8ec857..d27dd0845 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
@@ -141,7 +141,6 @@ public class RecreateRepositoryApplication extends AbstractApplication {
}
private ArtifactDescriptor createPack200ArtifactDescriptor(IArtifactKey key, File packFile, String installSize) {
- final String PACKED_FORMAT = "packed"; //$NON-NLS-1$
if (packFile != null && packFile.exists()) {
ArtifactDescriptor result = new ArtifactDescriptor(key);
@@ -149,7 +148,7 @@ public class RecreateRepositoryApplication extends AbstractApplication {
result.setProperty(IArtifactDescriptor.DOWNLOAD_SIZE, Long.toString(packFile.length()));
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
result.setProcessingSteps(steps);
- result.setProperty(IArtifactDescriptor.FORMAT, PACKED_FORMAT);
+ result.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
return result;
}
return null;
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java
index 1268c9bcb..84f23b209 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/IArtifactDescriptor.java
@@ -14,19 +14,61 @@ import java.util.Map;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
/**
+ * An artifact descriptor describes an artifact stored in some artifact repository. The
+ * descriptor defines the artifact it contains, as well as any processing steps that
+ * must be performed when the artifact is transferred out of the repository (such
+ * as decompression, error checking, etc).
+ *
* @since 2.0
*/
public interface IArtifactDescriptor {
+ /**
+ * An artifact descriptor property (value "download.size") indicating the number
+ * of bytes that will be transferred when this artifact is transferred out of the repository.
+ */
public static final String DOWNLOAD_SIZE = "download.size"; //$NON-NLS-1$
+ /**
+ * An artifact descriptor property (value "artifact.size") indicating the size in
+ * bytes of the artifact in its native format (after processing steps have been applied).
+ */
public static final String ARTIFACT_SIZE = "artifact.size"; //$NON-NLS-1$
+ /**
+ * An artifact descriptor property (value "download.md5") indicating the MD5
+ * checksum of the artifact bytes that are transferred.
+ */
public static final String DOWNLOAD_MD5 = "download.md5"; //$NON-NLS-1$
+ /**
+ * An artifact descriptor property (value "download.contentType") indicating the
+ * content type of the artifact bytes that are transferred.
+ */
public static final String DOWNLOAD_CONTENTTYPE = "download.contentType"; //$NON-NLS-1$
+ /**
+ * An content type (value "application/zip") indicating the content is a zip file.
+ */
public static final String TYPE_ZIP = "application/zip"; //$NON-NLS-1$
+ /**
+ * An artifact descriptor property (value "artifact.md5") indicating the MD5
+ * checksum of the artifact bytes in its native format (after processing steps have
+ * been applied).
+ */
public static final String ARTIFACT_MD5 = "artifact.md5"; //$NON-NLS-1$
+
+ /**
+ * An artifact descriptor property (value "format") indicating the storage format
+ * of the artifact in the repository.
+ * @see #FORMAT_PACKED
+ */
public static final String FORMAT = "format"; //$NON-NLS-1$
/**
+ * A property value for the {@link #FORMAT} artifact descriptor property (value "packed")
+ * indicating the storage format is using pack200 compression.
+ * @see #FORMAT
+ */
+ public static final String FORMAT_PACKED = "packed"; //$NON-NLS-1$
+
+ /**
* Return the key for the artifact described by this descriptor.
* @return the key associated with this descriptor
*/
@@ -49,7 +91,10 @@ public interface IArtifactDescriptor {
/**
* Return the list of processing steps associated with this descriptor.
* An empty set of steps implies that this descriptor describes a complete
- * copy of the artifact in its native form.
+ * copy of the artifact in its native form. If one or more steps are present,
+ * they may be performed when the artifact is transferred from the repository
+ * that contains it.
+ *
* @return the list of processing steps for this descriptor
*/
public abstract ProcessingStepDescriptor[] getProcessingSteps();
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ProcessingStepDescriptor.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ProcessingStepDescriptor.java
index 39e58d9c4..d4c0330f8 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ProcessingStepDescriptor.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ProcessingStepDescriptor.java
@@ -11,7 +11,13 @@
package org.eclipse.equinox.p2.repository.artifact;
/**
- * The description of a processor step.
+ * Describes a processing step. Processing steps are pieces of code that participate
+ * in the the transfer of an artifact between artifact repositories. A step may alter
+ * the shape of the artifact from its storage format in the repository (such as performing
+ * compression), or it may perform additional checks on the transferred bytes such as
+ * checksums or signature verification.
+ *
+ * @see IArtifactDescriptor#getProcessingSteps()
* @since 2.0
*/
public class ProcessingStepDescriptor {
@@ -34,6 +40,11 @@ public class ProcessingStepDescriptor {
this.required = required;
}
+ /**
+ * Returns the fully qualified id of the processing step extension.
+ *
+ * @return The fully qualified processing step extension id
+ */
public String getProcessorId() {
return processorId;
}
@@ -42,6 +53,16 @@ public class ProcessingStepDescriptor {
return data;
}
+ /**
+ * Returns whether the successful execution of this processing step is
+ * required for the transfer to be successful. If the processing step extension
+ * is not installed, or fails to execute, then the artifact transfer will fail if the
+ * step is required. Failure of optional steps will result in warnings but not prevent
+ * the transfer from succeeding.
+ *
+ * @return <code>true</code> if the transfer will fail if this step does not succeed,
+ * and <code>false</code> otherwise
+ */
public boolean isRequired() {
return required;
}
@@ -84,6 +105,9 @@ public class ProcessingStepDescriptor {
return true;
}
+ /**
+ * Returns a string representation of this descriptor for debugging purposes only.
+ */
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.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
index 50acfe6be..88ad541c4 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
@@ -130,7 +130,7 @@ public class Repo2RunnableTaskTests extends AbstractAntProvisioningTest {
else
assertFalse(desc + " is a folder", isFolder);
// Artifacts should not be packed
- assertTrue("Artifact is still packed", !"packed".equals(desc.getProperty("format")));
+ assertTrue("Artifact is still packed", !IArtifactDescriptor.FORMAT_PACKED.equals(desc.getProperty(IArtifactDescriptor.FORMAT)));
}
}
return true;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
index 813fbc39a..8afcfe8bf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
@@ -251,7 +251,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
// Create a descriptor for a packed repo
ArtifactDescriptor descriptor = new ArtifactDescriptor(new ArtifactKey("org.eclipse.update.feature", "test", Version.parseVersion("1.0.0")));
- descriptor.setProperty(IArtifactDescriptor.FORMAT, "packed");
+ descriptor.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
descriptor.setProcessingSteps(new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)});
// Create repository
@@ -358,7 +358,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
ArtifactDescriptor d1 = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "a", Version.create("1.0.0")));
ArtifactDescriptor d2 = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "a", Version.create("2.0.0")));
ArtifactDescriptor d3 = new ArtifactDescriptor(new ArtifactKey("osgi.bundle", "a", Version.create("2.0.0")));
- d3.setProperty(IArtifactDescriptor.FORMAT, "packed");
+ d3.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
repo.addDescriptor(d1);
repo.addDescriptor(d2);
@@ -371,7 +371,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
assertEquals(2, result.size());
assertFalse(result.toCollection().contains(d1));
- result = repo.query(new ArtifactDescriptorQuery(null, null, "packed"), null);
+ result = repo.query(new ArtifactDescriptorQuery(null, null, IArtifactDescriptor.FORMAT_PACKED), null);
assertEquals(1, result.size());
assertTrue(result.toCollection().contains(d3));
}
@@ -386,7 +386,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
key = new ArtifactKey("osgi.bundle", "a", Version.create("2.0.0"));
collection.add(new ArtifactDescriptor(key));
ArtifactDescriptor d = new ArtifactDescriptor(key);
- d.setProperty(IArtifactDescriptor.FORMAT, "packed");
+ d.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
collection.add(d);
map.put(key, collection);
@@ -430,7 +430,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
key = new ArtifactKey("osgi.bundle", "a", Version.create("2.0.0"));
collection.add(new ArtifactDescriptor(key));
ArtifactDescriptor d = new ArtifactDescriptor(key);
- d.setProperty(IArtifactDescriptor.FORMAT, "packed");
+ d.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
collection.add(d);
map.put(key, collection);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
index 1f581eecf..2e0bb6b5b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
@@ -900,7 +900,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
IArtifactDescriptor[] srcDescriptors = packedRepo.getArtifactDescriptors(key);
for (int j = 0; j < srcDescriptors.length; j++) {
- if (!(srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT) == null) && srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT).equals("packed")) {
+ if (!(srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT) == null) && srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT).equals(IArtifactDescriptor.FORMAT_PACKED)) {
//if we have a packed artifact
IArtifactDescriptor newDescriptor = new ArtifactDescriptor(key);
Map properties = new OrderedProperties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
index 6c9e0ccfa..f8bfa42d9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
@@ -915,7 +915,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
IArtifactDescriptor[] srcDescriptors = packedRepo.getArtifactDescriptors(key);
for (int j = 0; j < srcDescriptors.length; j++) {
- if (!(srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT) == null) && srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT).equals("packed")) {
+ if (!(srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT) == null) && srcDescriptors[j].getProperty(IArtifactDescriptor.FORMAT).equals(IArtifactDescriptor.FORMAT_PACKED)) {
//if we have a packed artifact
IArtifactDescriptor newDescriptor = new ArtifactDescriptor(key);
Map properties = new OrderedProperties();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
index 4ff2b76c4..90dca78a7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
@@ -152,7 +152,7 @@ public class BundlesActionTest extends ActionTest {
int packedIdx;
int canonicalIdx;
- if ("packed".equals(descriptors[0].getProperty(IArtifactDescriptor.FORMAT))) {
+ if (IArtifactDescriptor.FORMAT_PACKED.equals(descriptors[0].getProperty(IArtifactDescriptor.FORMAT))) {
packedIdx = 0;
canonicalIdx = 1;
} else {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
index 44e903c05..d1e856c44 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
@@ -753,7 +753,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
// Should have a packed & canonical version
assertEquals(2, descriptors.length);
- IArtifactDescriptor desc = "packed".equals(descriptors[0].getProperty("format")) ? descriptors[0] : descriptors[1];
+ IArtifactDescriptor desc = IArtifactDescriptor.FORMAT_PACKED.equals(descriptors[0].getProperty(IArtifactDescriptor.FORMAT)) ? descriptors[0] : descriptors[1];
OutputStream out = null;
try {
out = new FileOutputStream(output);
@@ -798,7 +798,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
IArtifactDescriptor[] descriptors = sourceRepo.getArtifactDescriptors(key);
IArtifactDescriptor descriptor = null;
for (int i = 0; i < descriptors.length && descriptor == null; i++)
- if ("packed".equals(descriptors[i].getProperty("format")))
+ if (IArtifactDescriptor.FORMAT_PACKED.equals(descriptors[i].getProperty(IArtifactDescriptor.FORMAT)))
descriptor = descriptors[i];
if (descriptor == null)
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java
index 6767b73c3..38064996d 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepositoryFactory.java
@@ -40,7 +40,6 @@ public class UpdateSiteArtifactRepositoryFactory extends ArtifactRepositoryFacto
private static final String PROP_ARTIFACT_REFERENCE = "artifact.reference"; //$NON-NLS-1$
private static final String PROP_FORCE_THREADING = "eclipse.p2.force.threading"; //$NON-NLS-1$
- private static final String PROP_FORMAT_PACKED = "packed"; //$NON-NLS-1$
private static final String PROP_SITE_CHECKSUM = "site.checksum"; //$NON-NLS-1$
private static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
@@ -119,7 +118,7 @@ public class UpdateSiteArtifactRepositoryFactory extends ArtifactRepositoryFacto
featureArtifactDescriptor.setRepositoryProperty(PROP_ARTIFACT_REFERENCE, featureURL.toString() + PACK_EXT);
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
featureArtifactDescriptor.setProcessingSteps(steps);
- featureArtifactDescriptor.setProperty(IArtifactDescriptor.FORMAT, PROP_FORMAT_PACKED);
+ featureArtifactDescriptor.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
allSiteArtifacts.add(featureArtifactDescriptor);
}
@@ -141,7 +140,7 @@ public class UpdateSiteArtifactRepositoryFactory extends ArtifactRepositoryFacto
artifactDescriptor.setRepositoryProperty(PROP_ARTIFACT_REFERENCE, pluginURL.toString() + PACK_EXT);
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)}; //$NON-NLS-1$
artifactDescriptor.setProcessingSteps(steps);
- artifactDescriptor.setProperty(IArtifactDescriptor.FORMAT, PROP_FORMAT_PACKED);
+ artifactDescriptor.setProperty(IArtifactDescriptor.FORMAT, IArtifactDescriptor.FORMAT_PACKED);
allSiteArtifacts.add(artifactDescriptor);
}
}

Back to the top