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 f28d97b29b9474f5930c332160f8cae571d2d140 Author: James Netherton <jamesnether...@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) {