private File[] createFiles(String parameter) { String[] filespecs = AbstractPublisherAction.getArrayFromString(parameter, ","); //$NON-NLS-1$ File[] result = new File[filespecs.length]; for (int i = 0; i < filespecs.length; i++) result[i] = new File(filespecs[i]); return result; }
/** * Returns the normalized string form of the given config spec. This is useful for putting * in IU ids etc. Note that the result is not intended to be machine readable (i.e., parseConfigSpec * may not work on the result). * @param configSpec the config spec to format * @return the readable format of the given config spec */ protected String createIdString(String configSpec) { String[] config = parseConfigSpec(configSpec); return config[0] + '.' + config[1] + '.' + config[2]; }
protected InstallableUnitDescription createParentIU(Collection<? extends IVersionedId> children, String id, Version version) { InstallableUnitDescription root = createIUShell(id, version); root.addRequirements(createIURequirements(children)); addSelfCapability(root); return root; }
/** * Adds all applicable touchpoint advice to the given installable unit. * @param iu The installable unit to add touchpoint advice to * @param currentInstructions The set of touchpoint instructions assembled for this IU so far * @param info The publisher info */ protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info) { processTouchpointAdvice(iu, currentInstructions, info, null); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected void addSelfCapability(InstallableUnitDescription root) { root.setCapabilities(new IProvidedCapability[] {createSelfCapability(root.getId(), root.getVersion())}); }
protected String createCUIdString(String id, String type, String flavor, String configSpec) { return flavor + id + "." + type + "." + createIdString(configSpec); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Creates and returns a collection of RequiredCapabilities for the IUs represented * by the given collection. The collection may include a mixture of IInstallableUnits * or VersionedNames. * @param children descriptions of the IUs on which requirements are to be made * @return a collection of RequiredCapabilities representing the given IUs */ protected Collection<IRequirement> createIURequirements(Collection<? extends IVersionedId> children) { ArrayList<IRequirement> result = new ArrayList<>(children.size()); for (IVersionedId next : children) { if (next instanceof IInstallableUnit) { IInstallableUnit iu = (IInstallableUnit) next; VersionRange range = new VersionRange(iu.getVersion(), true, iu.getVersion(), true); result.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), range, iu.getFilter() == null ? null : iu.getFilter(), false, false)); } else { Version version = next.getVersion(); VersionRange range = (version == null || Version.emptyVersion.equals(version)) ? VersionRange.emptyRange : new VersionRange(version, true, version, true); IMatchExpression<IInstallableUnit> filter = getFilterAdvice(next); result.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, next.getId(), range, filter, false, false)); } } return result; }
/** * Adds all applicable touchpoint advice to the given installable unit. * @param iu The installable unit to add touchpoint advice to * @param currentInstructions The set of touchpoint instructions assembled for this IU so far * @param info The publisher info */ protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info) { processTouchpointAdvice(iu, currentInstructions, info, null); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected void addSelfCapability(InstallableUnitDescription root) { root.setCapabilities(new IProvidedCapability[] {createSelfCapability(root.getId(), root.getVersion())}); }
protected String createCUIdString(String id, String type, String flavor, String configSpec) { return flavor + id + "." + type + "." + createIdString(configSpec); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Creates and returns a collection of RequiredCapabilities for the IUs represented * by the given collection. The collection may include a mixture of IInstallableUnits * or VersionedNames. * @param children descriptions of the IUs on which requirements are to be made * @return a collection of RequiredCapabilities representing the given IUs */ protected Collection<IRequirement> createIURequirements(Collection<? extends IVersionedId> children) { ArrayList<IRequirement> result = new ArrayList<IRequirement>(children.size()); for (IVersionedId next : children) { if (next instanceof IInstallableUnit) { IInstallableUnit iu = (IInstallableUnit) next; VersionRange range = new VersionRange(iu.getVersion(), true, iu.getVersion(), true); result.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), range, iu.getFilter() == null ? null : iu.getFilter(), false, false)); } else { Version version = next.getVersion(); VersionRange range = (version == null || Version.emptyVersion.equals(version)) ? VersionRange.emptyRange : new VersionRange(version, true, version, true); IMatchExpression<IInstallableUnit> filter = getFilterAdvice(next); result.add(MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, next.getId(), range, filter, false, false)); } } return result; }
/** * Returns the normalized string form of the given config spec. This is useful for putting * in IU ids etc. Note that the result is not intended to be machine readable (i.e., parseConfigSpec * may not work on the result). * @param configSpec the config spec to format * @return the readable format of the given config spec */ protected String createIdString(String configSpec) { String[] config = parseConfigSpec(configSpec); return config[0] + '.' + config[1] + '.' + config[2]; }
private File[] createFiles(String parameter) { String[] filespecs = AbstractPublisherAction.getArrayFromString(parameter, ","); //$NON-NLS-1$ File[] result = new File[filespecs.length]; for (int i = 0; i < filespecs.length; i++) result[i] = new File(filespecs[i]); return result; }
protected InstallableUnitDescription createParentIU(Collection<? extends IVersionedId> children, String id, Version version) { InstallableUnitDescription root = createIUShell(id, version); root.addRequirements(createIURequirements(children)); addSelfCapability(root); return root; }
/** * Adds all applicable touchpoint advice to the given installable unit. * @param iu The installable unit to add touchpoint advice to * @param currentInstructions The set of touchpoint instructions assembled for this IU so far * @param info The publisher info */ protected static void processTouchpointAdvice(InstallableUnitDescription iu, Map<String, ? extends Object> currentInstructions, IPublisherInfo info) { processTouchpointAdvice(iu, currentInstructions, info, null); }
/** * Returns the LDAP filter form that matches the given config spec. Returns * an empty String if the spec does not identify an ws, os or arch. * @param configSpec a config spec to filter * @return the LDAP filter for the given spec. <code>null</code> if the given spec does not * parse into a filter. */ protected IMatchExpression<IInstallableUnit> createFilterSpec(String configSpec) { String ldap = createLDAPString(configSpec); if (ldap == null) return null; return InstallableUnit.parseFilter(ldap); }
protected void addSelfCapability(InstallableUnitDescription root) { root.setCapabilities(new IProvidedCapability[] {createSelfCapability(root.getId(), root.getVersion())}); }
protected String createCUIdString(String id, String type, String flavor, String configSpec) { return flavor + id + "." + type + "." + createIdString(configSpec); //$NON-NLS-1$ //$NON-NLS-2$ }