diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java index bbe7cd346..68784218c 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java @@ -327,4 +327,18 @@ public class Util { String launcherConfig = profile.getProperty(IProfile.PROP_LAUNCHER_CONFIGURATION); return launcherConfig == null ? null : new File(launcherConfig); } + + public static String resolveArtifactParam(Map parameters) throws CoreException { + String artifactLocation = (String) parameters.get(EclipseTouchpoint.PARM_ARTIFACT_LOCATION); + if (artifactLocation != null) + return artifactLocation; + + IArtifactKey artifactKey = (IArtifactKey) parameters.get(EclipseTouchpoint.PARM_ARTIFACT); + if (artifactKey == null) { + IInstallableUnit iu = (IInstallableUnit) parameters.get(EclipseTouchpoint.PARM_IU); + throw new CoreException(Util.createError(NLS.bind(Messages.iu_contains_no_arifacts, iu))); + } + + throw new CoreException(Util.createError(NLS.bind(Messages.artifact_file_not_found, artifactKey))); + } } |