You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ji...@apache.org on 2024/03/20 10:57:01 UTC

(camel-quarkus) 29/33: Resolve capabilities catalog items

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

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

commit 8fbcb8b2020945cd3d2949c8f553974ba1d1abf5
Author: James Netherton <ja...@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);
+    }
 }