public FeaturePackLocation getResolvedLocation(Path installation, String location) throws ProvisioningException { if (location.endsWith("" + FeaturePackLocation.FREQUENCY_START) || location.endsWith("" + FeaturePackLocation.BUILD_START)) { location = location.substring(0, location.length() - 1); } // A producer spec without any universe nor channel. if (!location.contains("" + FeaturePackLocation.UNIVERSE_START) && !location.contains("" + FeaturePackLocation.CHANNEL_START)) { location = new FeaturePackLocation(universe.getDefaultUniverseSpec(installation), location, null, null, null).toString(); } FeaturePackLocation loc = FeaturePackLocation.fromString(location); return getResolvedLocation(installation, loc); }
specId = new ResolvedSpecId(FeaturePackLocation.fromString(str.substring(1, i)).getProducer(), str.substring(i + 1, colon)); } catch (IllegalArgumentException e) { throw new ProvisioningDescriptionException("Failed to parse the channel part of feature id '" + str + "'", e);
long lastUsage = Long.decode(time); Path p = LayoutUtils.getFeaturePackDir(config.getLayoutCache(), FeaturePackLocation.fromString(k).getFPID()); if (!Files.exists(p)) { toRemove.add(k); toRemove.add(k); try { cacheManager.remove(FeaturePackLocation.fromString(k).getFPID()); } catch (ProvisioningException ex) { CliLogging.exception(ex);
static FeaturePackLocation parseFpl(XMLExtendedStreamReader reader, int i) throws XMLStreamException { try { return FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch(IllegalArgumentException e) { throw ParsingUtils.error("Failed to parse feature-pack location " + reader.getAttributeValue(i), reader.getLocation(), e); } }
static FeaturePackLocation parseFpl(XMLExtendedStreamReader reader, int i) throws XMLStreamException { try { return FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch(IllegalArgumentException e) { throw ParsingUtils.error("Failed to parse feature-pack location " + reader.getAttributeValue(i), reader.getLocation(), e); } } }
@Override protected List<String> getItems(PmCompleterInvocation completerInvocation) { @SuppressWarnings("unchecked") InstallCommand cmd = (InstallCommand) completerInvocation.getCommand(); try { String model = cmd.getModel(completerInvocation.getPmSession()); String fpid = cmd.getId(completerInvocation.getPmSession()); if (fpid != null) { FeaturePackLocation loc = FeaturePackLocation.fromString(fpid); List<String> ret = new ArrayList<>(); String buffer = completerInvocation.getGivenCompleteValue(); Set<String> excluded = new HashSet<>(); if (buffer != null) { String[] arr = buffer.split(","); for (String a : arr) { if (!a.isEmpty()) { excluded.add(a.trim()); } } } ret.addAll(LayersConfigBuilder.getLayerNames(completerInvocation.getPmSession(), model, loc, excluded)); return ret; } } catch (Exception ex) { CliLogging.error(ex.toString()); } return null; }
private static FeaturePackLocation parseSource(XMLExtendedStreamReader reader) throws XMLStreamException { final int count = reader.getAttributeCount(); FeaturePackLocation fps = null; for (int i = 0; i < count; i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i)); switch (attribute) { case LOCATION: try { fps = FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch (IllegalArgumentException e) { throw new XMLStreamException("Failed to parse feature-pack location", e); } break; default: throw ParsingUtils.unexpectedContent(reader); } } if (fps == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.LOCATION)); } return fps; }
private static FeaturePackLocation parseSource(XMLExtendedStreamReader reader) throws XMLStreamException { final int count = reader.getAttributeCount(); FeaturePackLocation fps = null; for (int i = 0; i < count; i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i)); switch (attribute) { case LOCATION: try { fps = FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch (IllegalArgumentException e) { throw new XMLStreamException("Failed to parse feature-pack location", e); } break; default: throw ParsingUtils.unexpectedContent(reader); } } if (fps == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.LOCATION)); } return fps; }
private static FeaturePackLocation parseSource(XMLExtendedStreamReader reader) throws XMLStreamException { final int count = reader.getAttributeCount(); FeaturePackLocation fps = null; for (int i = 0; i < count; i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i)); switch (attribute) { case LOCATION: try { fps = FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch (IllegalArgumentException e) { throw new XMLStreamException("Failed to parse feature-pack location", e); } break; default: throw ParsingUtils.unexpectedContent(reader); } } if (fps == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.LOCATION)); } return fps; }
private FeaturePackLocation readSource(XMLExtendedStreamReader reader) throws XMLStreamException { FeaturePackLocation location = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i).getLocalPart()); switch (attribute) { case LOCATION: try { location = FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch (IllegalArgumentException e) { throw new XMLStreamException(ParsingUtils.error("Failed to parse feature-pack location", reader.getLocation()), e); } break; default: throw ParsingUtils.unexpectedContent(reader); } } if (location == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.LOCATION)); } return location; }
localPath = resolveMaven(featurePack, new MavenArtifactRepositoryManager(repoSystem, repoSession)); } else if(location != null) { fpl = FeaturePackLocation.fromString(location); } else { throw new MojoExecutionException("Either 'location' or 'feature-pack' must be configured");
private void parsePatchFor(final XMLExtendedStreamReader reader, FeaturePackSpec.Builder builder) throws XMLStreamException { final int count = reader.getAttributeCount(); FPID patchFor = null; for (int i = 0; i < count; i++) { final Attribute attribute = Attribute.of(reader.getAttributeName(i).getLocalPart()); switch (attribute) { case FOR: final FeaturePackLocation location; try { location = FeaturePackLocation.fromString(reader.getAttributeValue(i)); } catch(IllegalArgumentException e) { throw new XMLStreamException("Failed to parse patch for FPID '" + reader.getAttributeValue(i) + "'", e); } patchFor = ProvisioningXmlParser20.resolveUniverse(builder, location).getFPID(); break; default: throw ParsingUtils.unexpectedContent(reader); } } if (patchFor == null) { throw ParsingUtils.missingAttributes(reader.getLocation(), Collections.singleton(Attribute.FOR)); } ParsingUtils.parseNoContent(reader); if(patchFor.getBuild() == null) { throw new XMLStreamException("Build number is missing for the version the patch is applied to: " + patchFor); } builder.setPatchFor(patchFor); }
fpl = pm.getLayoutFactory().addLocal(path, false); } else { fpl = FeaturePackLocation.fromString(fp.getLocation());