use of io.quarkus.vertx.http.deployment.spi.AdditionalStaticResourceBuildItem in project kogito-runtimes by kiegroup.
the class KogitoQuarkusResourceUtils method registerResources.
public static void registerResources(Collection<GeneratedFile> generatedFiles, BuildProducer<AdditionalStaticResourceBuildItem> staticResProducer, BuildProducer<NativeImageResourceBuildItem> resource, BuildProducer<GeneratedResourceBuildItem> genResBI) {
for (GeneratedFile f : generatedFiles) {
if (f.category() == GeneratedFileType.Category.INTERNAL_RESOURCE || f.category() == GeneratedFileType.Category.STATIC_HTTP_RESOURCE) {
genResBI.produce(new GeneratedResourceBuildItem(f.relativePath(), f.contents(), true));
resource.produce(new NativeImageResourceBuildItem(f.relativePath()));
}
if (f.category() == GeneratedFileType.Category.STATIC_HTTP_RESOURCE) {
// keep '/' at the beginning
String resoucePath = f.relativePath().substring(GeneratedFile.META_INF_RESOURCES.length() - 1);
staticResProducer.produce(new AdditionalStaticResourceBuildItem(resoucePath, false));
}
}
}
Aggregations