use of org.jboss.galleon.cli.path.FeatureContainerPathConsumer 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.path.FeatureContainerPathConsumer in project galleon by wildfly.
the class StateResetConfigCommand method getConfiguration.
protected ConfigInfo getConfiguration(State state) throws PathParserException, PathConsumerException, ProvisioningException, Exception {
String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(state.getContainer(), false);
PathParser.parse(path, consumer);
ConfigInfo ci = consumer.getConfig();
if (ci == null) {
throw new ProvisioningException("Not a valid config " + configuration);
}
return ci;
}
Aggregations