use of org.jboss.galleon.cli.model.Group in project galleon by wildfly.
the class PackagesUtil method getPackage.
public static String getPackage(PmSession session, FeaturePackLocation.FPID fpid, String pkg) throws PathParserException, PathConsumerException, ProvisioningException, Exception {
String path = FeatureContainerPathConsumer.PACKAGES_PATH + pkg + (pkg.endsWith("" + PathParser.PATH_SEPARATOR) ? "" : PathParser.PATH_SEPARATOR);
FeatureContainer full = FeatureContainers.fromFeaturePackId(session, fpid, null);
FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(full, false);
PathParser.parse(path, consumer);
Group grp = consumer.getCurrentNode(path);
if (grp == null || grp.getPackage() == null) {
throw new ProvisioningException("Not a valid package " + pkg);
}
return grp.getPackage().getSpec().getName();
}
use of org.jboss.galleon.cli.model.Group in project galleon by wildfly.
the class FeatureContainerPathConsumer method enterFeaturesContent.
private void enterFeaturesContent(PathParser.Node node) throws PathConsumerException {
Group next = null;
if (current == null) {
current = info.getFeatureSpecs().get(featuresGav);
if (current == null) {
throw new PathConsumerException("no feature in " + featuresGav);
}
}
for (Group info : current.getGroups()) {
if (info.getIdentity().getName().equals(node.getName())) {
next = info;
break;
}
}
if (next == null) {
if (completion) {
if (inError) {
throw new PathConsumerException("no node for name " + node.getName());
} else {
inError = true;
}
} else {
throw new PathConsumerException("no node for name " + node.getName());
}
} else {
current = next;
}
featuresGav = null;
}
Aggregations