You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2024/07/04 07:05:12 UTC

(camel-quarkus) 12/20: Handle special case ical zones during build time processing

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

commit 55b6fa230331c6a8d51ddab92ab43e4e3f8d2f89
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Jun 28 14:36:13 2024 +0100

    Handle special case ical zones during build time processing
---
 .../quarkus/component/ical/deployment/IcalProcessor.java | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/extensions/ical/deployment/src/main/java/org/apache/camel/quarkus/component/ical/deployment/IcalProcessor.java b/extensions/ical/deployment/src/main/java/org/apache/camel/quarkus/component/ical/deployment/IcalProcessor.java
index da5fd0eaa8..8a1afdd616 100644
--- a/extensions/ical/deployment/src/main/java/org/apache/camel/quarkus/component/ical/deployment/IcalProcessor.java
+++ b/extensions/ical/deployment/src/main/java/org/apache/camel/quarkus/component/ical/deployment/IcalProcessor.java
@@ -61,11 +61,21 @@ class IcalProcessor {
             timezoneData.values()
                     .stream()
                     .map(Objects::toString)
-                    .map(timeZone -> timeZone.split("/")[0])
+                    .map(timeZone -> {
+                        String[] zoneParts = timeZone.split("/");
+                        if (zoneParts.length == 2) {
+                            return zoneParts[0];
+                        } else if (zoneParts.length == 3) {
+                            return zoneParts[0] + "/" + zoneParts[1];
+                        }
+                        return null;
+                    })
                     .distinct()
                     .forEach(region -> {
-                        nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo/" + region));
-                        nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo-global/" + region));
+                        if (region != null) {
+                            nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo/" + region));
+                            nativeResourceDirs.produce(new NativeImageResourceDirectoryBuildItem("zoneinfo-global/" + region));
+                        }
                     });
 
         } catch (IOException e) {