@Override public String toString() { return toString(universeSpec, producer, channel, frequency, build); } }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append(location.toString()); if (!layers.isEmpty()) { builder.append(" layers[ "); for (ConfigId l : layers) { builder.append(l.getModel()).append("/").append(l.getName()).append(" "); } builder.append("]"); } return builder.toString(); } }
@Override public String toString() { final StringBuilder buf = new StringBuilder(); buf.append('['); if(transitive) { buf.append("transitive "); } buf.append(fpl.toString()); if(!patches.isEmpty()) { buf.append(" patches="); StringUtils.append(buf, patches); } append(buf); return buf.append(']').toString(); } }
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); }
@Override protected String processingContent(ProgressTracker<FPID> tracker) { return session.getExposedLocation(null, tracker.getItem().getLocation()).toString(); }
@Override protected String processingContent(ProgressTracker<FPID> tracker) { return session.getExposedLocation(null, tracker.getItem().getLocation()).toString(); }
@Override protected String processingContent(ProgressTracker<ProducerSpec> tracker) { return session.getExposedLocation(null, tracker.getItem().getLocation()).toString(); }
@Override protected List<String> getItems(PmCompleterInvocation completerInvocation) { State session = completerInvocation.getPmSession().getState(); List<String> lst = new ArrayList<>(); if (session != null) { for (FeaturePackConfig fp : session.getConfig().getFeaturePackDeps()) { String loc = completerInvocation.getPmSession(). getExposedLocation(null, fp.getLocation()).toString(); lst.add(loc); } } return lst; }
@Override protected List<String> getItems(PmCompleterInvocation completerInvocation) { CommandWithInstallationDirectory cmd = (CommandWithInstallationDirectory) completerInvocation.getCommand(); Path installation = cmd.getInstallationDirectory(completerInvocation. getAeshContext()); List<FeaturePackLocation> locations = getInstallationLocations(installation, completerInvocation.getPmSession(), false, true); List<String> items = new ArrayList<>(); for (FeaturePackLocation loc : locations) { items.add(completerInvocation.getPmSession(). getExposedLocation(installation, loc).toString()); } return items; }
protected String getId(PmSession session) throws CommandExecutionException { String streamName = (String) getValue(ARGUMENT_NAME); if (streamName == null) { // Check in argument or option, that is the option completion case. streamName = getArgumentValue(); } if (streamName != null) { try { return session.getResolvedLocation(getInstallationDirectory(session.getAeshContext()), streamName).toString(); } catch (ProvisioningException ex) { // Ok, no id set. } } return null; } }
@Override protected Set<ProvisioningOption> getPluginOptions(FeaturePackLocation loc) throws ProvisioningException { try { //If we have a file, retrieve the options from the file. String file = (String) getValue(FILE_OPTION_NAME); if (file == null) { // Check in argument or option, that is the option completion case. file = getOptionValue(FILE_OPTION_NAME); } if (file == null) { return pmSession.getResolver().get(loc.toString(), PluginResolver.newResolver(pmSession, loc)).getInstall(); } else { return pmSession.getResolver().get(file, PluginResolver.newResolver(pmSession, loc)).getInstall(); } } catch (InterruptedException ex) { Thread.interrupted(); throw new ProvisioningException(ex); } catch (ExecutionException ex) { throw new ProvisioningException(ex.getCause()); } }
static void writeFeaturePackConfig(ElementNode fp, FeaturePackLocation location, FeaturePackConfig featurePack, String origin) { addAttribute(fp, Attribute.LOCATION, location.toString()); if(origin != null) { addElement(fp, Element.ORIGIN.getLocalName(), ns).addChild(new TextNode(origin));