use of org.jboss.galleon.cli.model.FeatureContainer in project galleon by wildfly.
the class ConfigurationUtil method getConfig.
private static ConfigInfo getConfig(PmSession session, FPID fpid, String configuration) throws ProvisioningException, IOException, PathParserException, PathConsumerException {
String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
FeatureContainer full = FeatureContainers.fromFeaturePackId(session, fpid, null);
ConfigInfo ci = null;
try {
FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(full, false);
PathParser.parse(path, consumer);
ci = consumer.getConfig();
} catch (PathParserException | PathConsumerException ex) {
// XXX OK, return null
}
return ci;
}
use of org.jboss.galleon.cli.model.FeatureContainer 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();
}
Aggregations