Community
Participate
Working Groups
Coming out of bug 249035. With ArtifactDescriptors storing an MD5 sum for the artifact, it is important for the descriptor to match the actual file. This is managed via the ArtifactDescriptor equals and hashCode, and the implementation of these methods depends on the Repository's implementation of IArtifactRepository#getOutputStream. Therefore, ArtifactDescriptor should not be API. Any implementor of IArtifactRepository should also implement an IArtifactDescriptor. Adding a method IArtifactRepository#createArtifactDescriptor(IArtifactKey) would be useful. And move ArtifactDescriptor to org.eclipse.equinox.internal.p2.artifact.repository.simple
Making ArtifactDescriptor not API turns out to be a large change. The new proposal is IArtifactDescript#equals and #hashcode will be defined as API. This makes the implementation of these methods independent of the repository implementations. Repository implementations will need to account for this. The proposed implentation uses the artifact key (id & version), the processing steps, and the format property (IArtifactDescriptor.FORMAT). The existing implementation also considers the ArtifactDescriptor.ARTIFACT_REFERENCE property. We will need to review the use of this when removing it from the equals & hashCode.
I think IArtifactKey may have the same problem and its implementation class is not API.
I have gone ahead and added IArtifactRepository#createArtifactDescriptor to help with publishing in the case when the person publishing needs to set repo specific items on the descriptor, as an example, RepositoryListener sets repository properties for artifact references.
I think this is done. Anything else can go in bug 293340