use of org.apache.karaf.features.internal.service.FeaturesProcessingSerializer in project fuse-karaf by jboss-fuse.
the class FeatureProcessingTest method writeProcessingInstructions.
@Test
public void writeProcessingInstructions() {
FeaturesProcessing fp1 = InternalUtils.loadFeatureProcessing(new File("src/test/resources/processing/oakf.1.xml"), null);
fp1.getBlacklistedBundles().add("mvn:x/y");
fp1.getBlacklistedFeatures().add(new FeaturesProcessing.BlacklistedFeature("f", "1"));
FeaturesProcessingSerializer serializer = new FeaturesProcessingSerializer();
serializer.write(fp1, System.out);
System.out.flush();
}
use of org.apache.karaf.features.internal.service.FeaturesProcessingSerializer in project fuse-karaf by jboss-fuse.
the class InternalUtils method loadFeatureProcessing.
/**
* Loads processing definition, possibly with additional version properties
* @param featureProcessing location of feature processing file
* @param properties properties for placeholder resolver
* @return
*/
public static FeaturesProcessing loadFeatureProcessing(File featureProcessing, File properties) {
try {
Properties props = new Properties();
if (properties != null && properties.isFile()) {
try (FileInputStream fis = new FileInputStream(properties)) {
props.load(fis);
}
}
FeaturesProcessingSerializer serializer = new FeaturesProcessingSerializer();
try (FileInputStream fis = new FileInputStream(featureProcessing)) {
return serializer.read(fis, props);
}
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
Aggregations