[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| [p2-dev] touchpoint actions and feature artifacts | 
Question:
I'm creating a new touchpoint, and inside an action within this 
touchpoint I have code that looks like this:
       IInstallableUnit iu = (IInstallableUnit) parameters
               .get(ActionConstants.PARM_IU);
       if (iu.getArtifacts() == null || iu.getArtifacts().length == 0)
           return Status.OK_STATUS;
       IArtifactKey artifactKey = iu.getArtifacts()[0];
the intention here is to get the artifact (jar) and then mess with it 
(actually to get some stuff out of it but that's not material to this 
question).
The problem I'm experiencing is that when the iu is a *feature* the call 
to iu.getArtifacts() returns null and so
       if (iu.getArtifacts() == null || iu.getArtifacts().length == 0)
           return Status.OK_STATUS;
  is executed and my action doesn't do what I want it to do.
Obviously this isn't what is desired.  Is there some other pattern of 
code to use to access the feature jar artifact from inside the action?  
Or is it necessary to always put these things in a bundle (rather than a 
feature)?  I have verified that the feature jar exported to the repo 
contains the artifacts that I'm looking for, so if I could get to the 
feature.jar artifact then I would be there I believe.
Thanksinadvance for any info.
Scott