This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/camel-main by this push:
     new d6ce5d653a Resolve capabilities catalog items
d6ce5d653a is described below

commit d6ce5d653a5bbe8b98eae9ac4719ebbd9fd4edec
Author: James Netherton <jamesnether...@gmail.com>
AuthorDate: Tue Mar 19 09:38:48 2024 +0000

    Resolve capabilities catalog items
---
 .../camel/catalog/quarkus/QuarkusRuntimeProvider.java     | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/catalog/src/main/java/org/apache/camel/catalog/quarkus/QuarkusRuntimeProvider.java
 
b/catalog/src/main/java/org/apache/camel/catalog/quarkus/QuarkusRuntimeProvider.java
index 4760cda6e2..617725bce2 100644
--- 
a/catalog/src/main/java/org/apache/camel/catalog/quarkus/QuarkusRuntimeProvider.java
+++ 
b/catalog/src/main/java/org/apache/camel/catalog/quarkus/QuarkusRuntimeProvider.java
@@ -20,6 +20,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TreeMap;
 
 import org.apache.camel.catalog.CamelCatalog;
 import org.apache.camel.catalog.RuntimeProvider;
@@ -38,6 +41,7 @@ public class QuarkusRuntimeProvider implements 
RuntimeProvider {
     private static final String LANGUAGE_DIR = 
"org/apache/camel/catalog/quarkus/languages";
     private static final String TRANSFORMER_DIR = 
"org/apache/camel/catalog/quarkus/transformers";
     private static final String OTHER_DIR = 
"org/apache/camel/catalog/quarkus/others";
+    private static final String CAPABILITIES_CATALOG = 
"org/apache/camel/catalog/quarkus/capabilities.properties";
     private static final String COMPONENTS_CATALOG = 
"org/apache/camel/catalog/quarkus/components.properties";
     private static final String DEV_CONSOLE_CATALOG = 
"org/apache/camel/catalog/quarkus/consoles.properties";
     private static final String DATA_FORMATS_CATALOG = 
"org/apache/camel/catalog/quarkus/dataformats.properties";
@@ -186,4 +190,15 @@ public class QuarkusRuntimeProvider implements 
RuntimeProvider {
         return names;
     }
 
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @Override
+    public Map<String, String> findCapabilities() {
+        final Properties properties = new Properties();
+        try (InputStream is = 
getCamelCatalog().getVersionManager().getResourceAsStream(CAPABILITIES_CATALOG))
 {
+            properties.load(is);
+        } catch (IOException e) {
+            // ignore
+        }
+        return new TreeMap<>((Map<String, String>) (Map) properties);
+    }
 }

Reply via email to