Community
Participate
Working Groups
Build Identifier: 3.7 When managing deployments in a production environment, a common need is to take a bundle packaged as a jar and put it into a repository. This requires building an IInstallableUnit from the jar. The code to do this already exists in the publisher but it is not accessible through API. This code can currently be used by calling PublisherUtil.createBundleIU (which is not API). But then we need an artifact key in advance which we can't create until we have read the jar to build the IU. The way around this is to implement a delegate IArtifactKey to pass to createBundleIU and then create the actual artifact key afterwards. It is not clean but it works because createBundleIU doesn't call any methods on the artifact key. Another way of doing this is to use BundlesAction class which is not API either but will do the job if you make sure there are no other jars in the directory other than the ones you want. An API that would work well would basically be createBundleIU with the following changes: 1. make it API 2. remove the artifact key parameter. It is easy to create this key inside the ? method. 3. use InputStream instead of File as the input parameter. It is easy enough for a user to create an InputStream from a file if needed and in many cases, including mine, the jar does not come directly from the local file system and it would be nice not to have to write it for no particular reason to the local file system. Another consideration would be to follow the p2 convention of using the push model, ie have a class that implements OutputStream and that has a getIu method that can be called after the stream has been closed. This would be more work and I really have no preference here - I just mention it because this would be consistent with the getOutputStream(IArtifactDescriptor) and getArtifact(IArtifactDescriptor, OutputStream) methods in IArtifactRepository. I would be very happy to attach a patch if that helps but I wanted to get some feedback first. Reproducible: Always
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.